Search Issue Tracker
Fixed in 2019.3.X
Votes
1
Found in
2019.3.0a4
Issue ID
1157050
Regression
Yes
NullReferenceException occurs on reloading the Inspector with a C# script selected
If you have a C# script selected in Project View and the inspector is reloaded (either by recompiling or importing/refreshing the file), a NullReferenceException will occur.
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.AssetImporters.AssetImporterEditor.InternalSetTargets (UnityEngine.Object[] t) (at C:/buildslave/unity/build/Modules/AssetPipelineEditor/ImportSettings/AssetImporterEditor.cs:122)
UnityEditor.Editor.OnForceReloadInspector () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:603)
1. Open Unity
2. Open the attached project
3. Find TestScript in the Project View and select it so the Inspector displays info about it
4. Right Click on the TestScript and Reimport
5. Right Click on the TestScript and Refresh
You can also see this happen by double clicking the TestScript in Project View to open it in a code editor, make changes and then return to the editor. The error will occur after recompiling.
Expected Result:
No errors appear in the console.
Actual Result:
A NullReferenceException occurs in the console.
Tested on Windows.
Reproduced on 2019.3.0a4
Cannot Reproduce on 2019.2.0b3, 2019.3.0a2, 2019.3.0a3
Comments (6)
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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
ZOTGames
Oct 02, 2020 17:17
I have the same problem at Unity 2020.1.6f1
on open Inspector or Project Settings Window :/
NotExistingUser
Sep 22, 2019 10:23
I'm experiencing this on Linux, .3.0a5. I haven't yet found a way around it and I can't load my scripts. It would be nice to have this fixed so we could, you know, use your editor.
TurnipLord
Jun 26, 2019 20:21
Still reproducing in 2019.3.0a5
TimTheEnchanter
Jun 22, 2019 02:00
Also reproducing in 2019.3.0a5
xwheat32x
Jun 11, 2019 13:48
Issue is still reproducible in 2019.3.0a5.
Rodolfo-Rubens
Jun 08, 2019 03:47
Still reproducible in 2019.3.0a5.