Search Issue Tracker

Fixed in 2018.2

Votes

0

Found in

2017.2.0p4

2017.1.0a4

Issue ID

977937

Regression

Yes

NullReferenceException thrown on script EditorGUILayout.BeginHorizontal

Themes

-

Reproduction steps:
1. Download project "MeshCookingTest.zip" and open in Unity
2. Open scene Main
3. Select Main Toolbar -> Custom Tools -> Blocks Merge Tool
4. Press Add From Hierarchy button
5. Press Merge button

Expected: no error in console
Actual: error appears in the console

Reproduced on: 2017.1.0a4; 2017.1.3f1; 2017.2.1p1; 2017.3.0p1; 2018.1.0b1
Not reproduced on: 5.6.5f1; 2017.1.0a1; 2017.1.0a3
Regression introduced: 2017.1.0a4

Note:
The error is thrown in EditorGUILayout.BeginHorizontal line.
Error message (in some versinos error message varies):
"NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at C:/buildslave/unity/build/Modules/IMGUI/GUILayoutUtility.cs:317)
UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7789)
UnityEditor.EditorGUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7769)
BlocksMergeTool.Draw () (at Assets/Scripts/Editor/BlocksMergeTool.cs:80)
BlocksMergeToolEditorWindow.OnGUI () (at Assets/Scripts/Editor/BlocksMergeToolEditorWindow.cs:23)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:251)"

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.