question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullReferenceException on asset database refresh

See original GitHub issue

Description

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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
biosmanagercommented, Sep 16, 2020

@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

0reactions
jwittnercommented, Jan 5, 2021

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. =)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found