NullReferenceException on asset database refresh
See original GitHub issueDescription
NullReferenceException
on asset database refresh. Every now and then when some assets are updated, a couple of these messages appear in the log:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GameObjectInspector.ClearPreviewCache () (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.GameObjectInspector.ReloadPreviewInstances () (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.GameObjectInspector.OnForceReloadInspector () (at <8004fcc221b54f98ba547350ea71d812>:0)
UnityEditor.AssetDatabase:Refresh()
NugetForUnity.NugetHelper:Restore()
NugetForUnity.NugetHelper:.cctor()
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])
- NuGet Package: n/a
- NuGetForUnity Version: 2.0.1
- Unity Version: 2019.4.10f1
- Operating System: Windows 10 Version 2004 (64 bit)
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
AssetDatabase.SaveAssets() is giving a ...
I can't work out why I'm getting this NullReferenceException from AssetDatabase.SaveAssets(). The scriptable object isn't null, otherwise it ...
Read more >Null Reference Exceptions
Null Reference Exceptions. A NullReferenceException happens when you try to access a reference variable that isn't referencing any object.
Read more >Notification when AssetDatabase.Refresh is ready
I have a Unity3D editor class that creates a new asset on the fly. Then I call AssetDatabase.Refresh using the default option (which...
Read more >AssetDatabase.Refresh() refresher - Unite Copenhagen
The AssetDatabase has been rewritten. The more you know about how this API works, the stronger your code will be. This information can...
Read more >NullReferenceException whenever XAML is reloaded
From the callstack I will say is the AssetDatabase.SaveAssets() call and Unity trying to open a modal window which is throwing the exception...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jwittner
No, not really. The error frequently occurs when I change some script or asset but after I entered Play mode it disappears. IIRC this issue was also present on earlier Unity 2019.x versions.
This issue from another project could be related: https://github.com/playgameservices/play-games-plugin-for-unity/issues/1713
Since this appears to be a Unity issue, I’m closing this. If anyone finds/wants to contribute a work around in the N4U code, then I’d gladly accept one. =)