Search Issue Tracker
Fixed in 2018.3.X
Votes
0
Found in
2018.3.0a2
Issue ID
1051734
Regression
No
NullReferenceException overriding properties of UI objects by right clicking the property in the Inspector
If you have an object with UI components as a prefab and attempt to override a property of the UI component by right clicking in the Inspector and selecting apply, a NullReferenceException will occur. Note that this doesn't happen when applying changes via the Overrides dropdown.
NullReferenceException: SerializedObject of SerializedProperty has been Disposed.
UnityEditor.SerializedProperty.Verify (VerifyFlags verifyFlags) (at C:/buildslave/unity/build/Editor/Mono/SerializedProperty.bindings.cs:322)
UnityEditor.SerializedProperty.get_propertyPath () (at C:/buildslave/unity/build/Editor/Mono/SerializedProperty.bindings.cs:497)
UnityEditor.PrefabUtility.ApplyPrefabPropertyOverride (UnityEditor.SerializedProperty instanceProperty, System.String assetPath, InteractionMode action, Boolean singlePropertyOnly) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:455)
UnityEditor.PrefabUtility.ApplyPrefabPropertyOverride (UnityEditor.SerializedProperty instanceProperty, System.String assetPath, InteractionMode action) (at C:/buildslave/unity/build/Editor/Mono/Prefabs/PrefabUtility.cs:391)
UnityEditor.TargetChoiceHandler.ApplyPrefabPropertyOverride (System.Object userData) (at C:/buildslave/unity/build/Editor/Mono/GUI/TargetChoiceHandler.cs:57)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, Int32 selected) (at C:/buildslave/unity/build/Editor/Mono/GUI/GenericMenu.cs:119)
1. Install Unity
2. Open the attached project
3. Open TestScene.scene
4. Select "Image" from the Scene Hierarchy
5. Change any property on the Image Component
6. Right click on the name of the changed property in the Inspector and apply the overrides.
Result:
A NullRef occurs.
Expected Result:
The override should be applied correctly with no errors or exceptions.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Different build sizes between Editor build and command-line build when "Static Batching" is enabled
- Particle System "Start Rotation" property affects a different axis when upgrading to newer Editor versions
- "Light" Component's "Culling Mask" setting is hidden but still has an effect when using HDRP
- Selecting the Web platform can be done when using the HDRP project
- Textures swap when SpriteRenderers with shared materials and animators are toggled on and off
Add comment