Search Issue Tracker
Fixed
Fixed in 2021.3.17f1, 2022.2.3f1, 2023.1.0a25
Votes
0
Found in
2023.1.0a21
Issue ID
UUM-20711
Regression
No
Improve error message when saving out side of project
When trying to save from the UI builder outside of the project directory this exception will happen and nothing else gets reported to the user. I think it would be great if the error message could be improved.
{code:java}
NullReferenceException: Object reference not set to an instance of an object
Unity.UI.Builder.VisualTreeAssetExtensions.DeepOverwrite (UnityEngine.UIElements.VisualTreeAsset vta, UnityEngine.UIElements.VisualTreeAsset other) (at C:/code/unity_trunk/External/MirroredPackageSources/com.unity.ui.builder/Editor/Utilities/VisualTreeAssetExtensions/VisualTreeAssetExtensions.cs:44)
Unity.UI.Builder.BuilderDocumentOpenUXML.PostSaveToDiskChecksAndFixes (System.String newUxmlPath, System.Boolean needsFullRefresh) (at C:/code/unity_trunk/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:1019)
Unity.UI.Builder.BuilderDocumentOpenUXML.SaveNewDocument (UnityEngine.UIElements.VisualElement documentRootElement, System.Boolean isSaveAs, System.Boolean& needsFullRefresh, System.String manualUxmlPath) (at C:/code/unity_trunk/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Document/BuilderDocumentOpenUXML.cs:466)
Unity.UI.Builder.BuilderDocument.SaveNewDocument (UnityEngine.UIElements.VisualElement documentRootElement, System.Boolean isSaveAs, System.Boolean& needsFullRefresh, System.String manualUxmlPath) (at C:/code/unity_trunk/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Document/BuilderDocument.cs:272)
Unity.UI.Builder.BuilderToolbar.SaveDocument (System.Boolean isSaveAs) (at C:/code/unity_trunk/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Toolbar/BuilderToolbar.cs:376)
Unity.UI.Builder.BuilderToolbar.<SetUpFileMenu>b__45_5 (UnityEngine.UIElements.DropdownMenuAction a) (at C:/code/unity_trunk/External/MirroredPackageSources/com.unity.ui.builder/Editor/Builder/Toolbar/BuilderToolbar.cs:508)
UnityEngine.UIElements.DropdownMenuAction.Execute () (at C:/code/unity_trunk/ModuleOverrides/com.unity.ui/Core/DropdownMenu.cs:189)
UnityEditor.UIElements.EditorMenuExtensions+<>c__DisplayClass0_0.<PrepareMenu>b__0 () (at C:/code/unity_trunk/Editor/Mono/UIElements/EditorMenuExtensions.cs:35)
UnityEditor.GenericMenu.CatchMenu (System.Object userData, System.String[] options, System.Int32 selected) (at C:/code/unity_trunk/Editor/Mono/GUI/GenericMenu.cs:127) {code}
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
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
Resolution Note (fix version 2022.2.3f1):
Fixed for 2022.2.X: Improve error message when saving out side of project
Resolution Note (fix version 2021.3.17f1):
Fixed for 2021.3.X: Improve error message when saving outside of project