Search Issue Tracker
Duplicate
Votes
0
Found in
5.0.0b10
Issue ID
642722
Regression
Yes
MissingReferenceException when changing script on a component
Steps to repro:
1. Create an empty GameObject
2. Create a new script Test01 and add it to the empty GameObject
3. Create another script Test02
4. Replace the Test01 script on the GameObject with Test02
5. Observe the exeption:
MissingReferenceException: The object of type 'NewBehaviourScript' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.Editor.IsEnabled () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:536)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1046)
UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:933)
UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:333)
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-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
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
- LUT assets are not shown when selecting Spectral Lut with Advanced Object Selector
- GameObjects disappear from Scene view when hidden in Hierarchy and Scene view Eye icon is disabled with GPU Resident Drawer enabled
- [Android] Audio sound is lower in the Player compared to the native music player
- Feet slide and misalign when playing retargeted animations
- IndexOutOfRangeException is thrown in NativePassCompiler when a graphics buffer is used in more than 5 render passes
This is a duplicate of issue #635631