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
- Scene view has Y coordinates of the Screen Position node flipped when some of the URP features are disabled
- Volumetric fog shader variants are missing from build when "Strict Shader Variant Matching" is disabled
- Unnecessary modifications clutter the Scene when using a RectTransform driven by a LayoutGroup in a Prefab
- Files in the target folder are deleted without a proper warning when building an iOS project
- Character animation freezes when toggling animator on/off in a coroutine
Add comment