Search Issue Tracker

Fixed in 2018.2.X

Fixed in 2018.1.X

Votes

0

Found in

2018.1.0a6

Issue ID

989759

Regression

Yes

[2D] Null Reference exception when selecting Edit Outline after changing sprite's LRTB values

2D

-

Null Reference happens in 18.1
3 different errors happens in 18.2 (trunk)

18.1

Steps To Reproduce:

1. Import a new sprite.
2. Select the sprite and open the sprite editor.
3. Edit the border settings by changing the LRTB values.
4. Select Edit outline from the drop-down in the top left corner.
5. Let the Apply changes popup appear.
6. Hit apply and observe that null reference exception appears in the console

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.U2D.SpriteOutlineModule.SetupShapeEditorOutline (UnityEditor.SpriteRect spriteRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/2D/SpriteEditorModule/SpriteOutlineModule.cs:659)
UnityEditor.U2D.SpriteOutlineModule.GenerateOutlineIfNotExist () (at /Users/builduser/buildslave/unity/build/Editor/Mono/2D/SpriteEditorModule/SpriteOutlineModule.cs:362)
UnityEditor.U2D.SpriteOutlineModule.OnModuleActivate () (at /Users/builduser/buildslave/unity/build/Editor/Mono/2D/SpriteEditorModule/SpriteOutlineModule.cs:340)
UnityEditor.SpriteEditorWindow.SetupModule (Int32 newModuleIndex) (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:635)
UnityEditor.SpriteEditorWindow.DoToolbarGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:419)
UnityEditor.SpriteEditorWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:353)
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 /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:291)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:284)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:251)
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

Note: The outline popup doesn't show any progress and stays on the screen.

Workaround: Apply the changes manually from the sprite editor.

Works fine on : 2018.1.0a5, 2018.1.0a4, 2018.1.0a3, 2018.1.0a2, 2018.1.0a1, 2017.3.0f3, 2017.3.0f2

Reproducible on : 2018.1.0a6, 2018.1.0a7, 2018.1.0b1, 2018.1.0b2, 2018.1.0b3, 2018.1.0b4

Environment:
Occurs on mac only

---

18.2 trunk

Same steps give different errors:

ArgumentException: Getting control 2's position in a group with only 2 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at /Users/weswong/Work/trunk/unity/Modules/IMGUI/LayoutGroup.cs:117)
UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type layoutType) (at /Users/weswong/Work/trunk/unity/Modules/IMGUI/GUILayoutUtility.cs:362)
UnityEngine.GUILayoutUtility.DoBeginLayoutArea (UnityEngine.GUIStyle style, System.Type layoutType) (at /Users/weswong/Work/trunk/unity/Modules/IMGUI/GUILayoutUtility.cs:379)
UnityEditor.EditorGUILayoutUtilityInternal.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type LayoutType) (at /Users/weswong/Work/trunk/unity/Editor/Mono/GUI/EditorGUIInternal.cs:78)
UnityEditor.HostView.BeginOffsetArea (Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at /Users/weswong/Work/trunk/unity/Editor/Mono/HostView.cs:217)
UnityEditor.DockArea.OldOnGUI () (at /Users/weswong/Work/trunk/unity/Editor/Mono/GUI/DockArea.cs:360)
UnityEngine.Experimental.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt) (at /Users/weswong/Work/trunk/unity/Modules/UIElements/IMGUIContainer.cs:209)
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

Invalid GUIClip stack popping
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

Invalid ParentClips stack popping
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)

Add comment

Log in to post comment

All about bugs

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