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
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
Resolution Note (fix version 2021.2):
Fixed in: 2021.2.0a3