Search Issue Tracker
Fixed in 2021.2.X
Votes
0
Found in
2020.3
2021.1
2021.1.21f1
2021.2
Issue ID
1365362
Regression
No
NullReferenceException is thrown when deleting TSS Theme Files
How to reproduce:
1. Create a new 3D project
2. Create a new TSS Theme File (Assets > Right Click > Create > UI Toolkit > TSS Theme File)
3. Delete the TSS Theme File
4. Open Console and observe NullReferenceException
5. Repeat step 2
6. Open Console and observe a different error
Reproducible with: 2020.3.19f1, 2021.1.21f1, 2021.2.0a2
Not reproducible with: 2021.2.0a3, 2021.2.0b13, 2022.1.0a10
Could not test with: 2019.4.30f1(UI Toolkit unavailable)
Full errors:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.UIElements.StyleSheets.ThemeStyleSheetImporterEditor.LoadThemeAssetDefinitionState (UnityEditor.UIElements.StyleSheets.ThemeAssetDefinitionState extraData, System.String assetPath) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/StyleSheets/ThemeStyleSheetImporterEditor.cs:146)
UnityEditor.UIElements.StyleSheets.ThemeStyleSheetImporterEditor.InitializeExtraDataInstance (UnityEngine.Object extraData, System.Int32 targetIndex) (at /Users/bokken/buildslave/unity/build/External/MirroredPackageSources/com.unity.ui/Editor/StyleSheets/ThemeStyleSheetImporterEditor.cs:137)
UnityEditor.AssetImporters.AssetImporterEditor.ReloadAssetData (System.Int32 index) (at /Users/bokken/buildslave/unity/build/Modules/AssetPipelineEditor/ImportSettings/AssetImporterEditor.cs:730)
UnityEditor.AssetImporters.AssetImporterEditor.CheckForApplyOnClose (System.Boolean isQuitting) (at /Users/bokken/buildslave/unity/build/Modules/AssetPipelineEditor/ImportSettings/AssetImporterEditor.cs:642)
UnityEditor.AssetImporters.AssetImporterEditor.OnDisable () (at /Users/bokken/buildslave/unity/build/Modules/AssetPipelineEditor/ImportSettings/AssetImporterEditor.cs:568)
UnityEditor.ProjectBrowser:DeleteSelectedAssets(Boolean) (at /Users/bokken/buildslave/unity/build/Editor/Mono/ProjectBrowser.cs:2805)
The previous instance of UnityEditor.UIElements.StyleSheets.ThemeStyleSheetImporterEditor has not been disposed correctly. Make sure you are calling base.OnDisable() in your AssetImporterEditor implementation.
UnityEditor.AssetImporters.AssetImporterEditor:InternalSetTargets (UnityEngine.Object[]) (at /Users/bokken/buildslave/unity/build/Modules/AssetPipelineEditor/ImportSettings/AssetImporterEditor.cs:292)
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
- “[Worker0] Could not generate preview image“ error when opening macOS native plugin in the Inspector with Architecture to build for set to ARM 64-bit
- [iOS] Application.absoluteURL is empty on Awake/Start when opening via deep link with Splash Screen disabled
- Crash on MemoryManager::Deallocate when rapidly calling Addressables.LoadAssetAsync
- Crash on physx::shdfnd::atomicIncrement when adjusting values on a character controller component after entering Play mode in Prefab edit mode
- [Rendering Debugger] [NewInputSystem] Debug Overlays in Play mode throws InvalidOperationException when using New Input System
Resolution Note (fix version 2021.2):
Fixed in: 2021.2.0a3