Search Issue Tracker
Won't Fix
Won't Fix in 6000.5.X
Votes
0
Found in
6000.0.69f1
6000.3.10f1
6000.4.0b11
6000.5.0a8
Issue ID
UUM-135721
Regression
No
“GUIStyle” and “NullReferenceException” errors thrown in the Console when opening Object Field during script compilation
Steps to reproduce:
1. Create new Unity project
2. In Project window create new script
3. While new script is compiling select “Global Volume” in Hierarchy window
4. In Inspector window select Volume > Sample Scene Profile Object field
5. Observe the Console window
Actual results: “Unable to use a named GUIStyle without a current skin. Most likely you need to move your GUIStyle initialization code to OnGUI” and “NullReferenceException: Object reference not set to an instance of an object” errors are thrown in the Console window, object selection window breaks, doesn’t show anything
Expected results: No errors are thrown in the Console window, object selection window doesn’t break
Reproducible with versions: 6000.0.69f1, 6000.3.10f1, 6000.4.0b11, 6000.5.0a8
Tested on (OS): macOS Silicon Tahoe 26.3 (M1), Ubuntu 24.04
Notes:
- For longer compiling time, ScriptableObject Script can be created instead
- On 6000.0.69f1 different “NullReferenceException” errors are thrown:
{code:java}
NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.Verify (UnityEditor.SerializedProperty+VerifyFlags verifyFlags) (at /Users/bokken/build/output/unity/unity/Editor/Mono/SerializedProperty.bindings.cs:517)
UnityEditor.SerializedProperty.get_propertyType () (at /Users/bokken/build/output/unity/unity/Editor/Mono/SerializedProperty.bindings.cs:1013)
UnityEditor.EditorGUILayout.IsChildrenIncluded (UnityEditor.SerializedProperty prop) (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorGUILayout.cs:2084)
UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, UnityEngine.GUILayoutOption[] options) (at /Users/bokken/build/output/unity/unity/Editor/Mono/EditorGUILayout.cs:2068)
UnityEditor.TransformInspector.Inspector3D () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/TransformInspector.cs:85)
UnityEditor.TransformInspector.OnInspectorGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/Inspector/TransformInspector.cs:49)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass79_0.<CreateInspectorElementUsingIMGUI>b__2 () (at /Users/bokken/build/output/unity/unity/Editor/Mono/UIElements/Inspector/InspectorElement.cs:779)
UnityEditor.ObjectSelector:OnDisable() (at /Users/bokken/build/output/unity/unity/Editor/Mono/ObjectSelector.cs:215)
{code}
- 6000.3+ warnings:
{code:java}
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.ObjectSelector.GetSearchFilter () (at /Users/bokken/build/output/unity/unity/Editor/Mono/ObjectSelector.cs:488)
UnityEditor.ObjectSelector.FilterSettingsChanged () (at /Users/bokken/build/output/unity/unity/Editor/Mono/ObjectSelector.cs:443)
UnityEditor.ObjectSelector.InitIfNeeded () (at /Users/bokken/build/output/unity/unity/Editor/Mono/ObjectSelector.cs:827)
UnityEditor.ObjectSelector.CreateGUI () (at /Users/bokken/build/output/unity/unity/Editor/Mono/ObjectSelector.cs:1115)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <3eb0070ec3184acfa9cdfc9616bb21ab>:0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <3eb0070ec3184acfa9cdfc9616bb21ab>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <3eb0070ec3184acfa9cdfc9616bb21ab>:0)
UnityEditor.UIElements.DefaultEditorWindowBackend.Invoke (System.String methodName) (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/WindowBackends/DefaultEditorWindowBackend.cs:387)
UnityEditor.RetainedMode:UpdateSchedulers() (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/RetainedMode.cs:43)
{code}
{code:java}
Unable to use a named GUIStyle without a current skin. Most likely you need to move your GUIStyle initialization code to OnGUI
UnityEditor.RetainedMode:UpdateSchedulers () (at /Users/bokken/build/output/unity/unity/Modules/UIElementsEditor/RetainedMode.cs:43)
{code}
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Player GameObject can’t be selected in the Hierarchy window during Step 4 of the "Get Started" tutorial in 2D Platformer Microgame because Hierarchy window is masked
- Gradient marker colors are removed when undoing marker movement in the Inspector Gradient field
- Crash on RendererScene::NotifyInvisible when GameObjects are deleted from the Hierarchy in a specific Scene
- "Import projects" button doesn't work in Unity Hub
- Animation is affected by TimeScale when setting Animator's updateMode to UnscaledTime in onDisable()
Resolution Note:
Thank you for reporting a bug to Unity.
We have reviewed the issue carefully, and in this case, the team is unable to prioritize fixing this bug. There are a number of reasons we make this decision, including the impact and severity of the issue across our user and customer base, and the possibility that future plans may solve the problem in a different way, or that a workaround for the bug may be available.
Today we will be closing this case. Thank you again for taking the time to report this issue, and please let us know if there is anything else that changes the impact or severity of this issue.
Resolution Note (6000.5.X):
Thank you for reporting a bug to Unity.
We have reviewed the issue carefully, and in this case, the team is unable to prioritize fixing this bug. There are a number of reasons we make this decision, including the impact and severity of the issue across our user and customer base, and the possibility that future plans may solve the problem in a different way, or that a workaround for the bug may be available.
Today we will be closing this case. Thank you again for taking the time to report this issue, and please let us know if there is anything else that changes the impact or severity of this issue.