Search Issue Tracker

Fixed in 2017.1.X

Votes

0

Found in

5.6.0b3

Issue ID

863932

Regression

Yes

NullReferenceException or NotSupportedException if Sprite Renderer which uses Unity's built in sprite gets selected in hierarchy

2D

-

Steps to reproduce:

1. Create new project and add Sprite to the scene
2. Select it and assign any built in sprite to Sprite Renderer's Sprite field
3. Open Sprite Editor (this can be done by importing any sprite and opening sprite editor from texture importer inspector). Make sure that Sprite Editor is active (visible) window
4. Re-select sprite created in first step
5. Notice NotSupportedException exception thrown in console
6. Save scene, close and re-open unity and this project
7. Make sure that Sprite Editor window is active/visible and select Sprite created during the first step
8. Notice NullReferenceException thrown in console

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.SpriteEditorWindow.SelectSpriteIndex (UnityEngine.Sprite sprite) (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:644)
UnityEditor.SpriteEditorWindow.UpdateSelectedSprite () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:633)
UnityEditor.SpriteEditorWindow.OnSelectionChange () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:231)
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:257)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:250)
UnityEditor.HostView.OnSelectionChange () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:140)

NotSupportedException: Current implementation only supports TextureImporter.
UnityEditor.U2D.Interface.AssetDatabaseSystem.GetAssetImporterFromPath (System.String path) (at /Users/builduser/buildslave/unity/build/Editor/Mono/2D/Interface/IAssetDatabase.cs:25)
UnityEditor.SpriteFrameModuleBase.get_spriteImportMode () (at /Users/builduser/buildslave/unity/build/Editor/Mono/2D/SpriteEditorModule/SpriteFrameModule/SpriteFrameModuleBase.cs:70)
UnityEditor.SpriteFrameModule.CanBeActivated () (at /Users/builduser/buildslave/unity/build/Editor/Mono/2D/SpriteEditorModule/SpriteFrameModule/SpriteFrameModule.cs:41)
UnityEditor.SpriteEditorWindow.UpdateAvailableModules () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:758)
UnityEditor.SpriteEditorWindow.OnSelectionChange () (at /Users/builduser/buildslave/unity/build/Editor/Mono/SpriteEditor/SpriteEditorWindow.cs:232)
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:257)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:250)
UnityEditor.HostView.OnSelectionChange () (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:140)

Reproduced with: 5.5.0f1, 5.5.0p3, 5.6.0b3
Not reproducible: 5.4.4f1

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.