0
Fixed

Peek : Linux : NullReferenceException: PluginContainer.Initialize()

MostHated 2 months ago updated by Lazlo Bonin (Lead Developer) 2 months ago 9 1 duplicate

Hey there,

    Unfortunately, I keep getting this error fairly randomly. Sometimes on play, sometimes after the completion of a compilation.

Thanks,

-MH

[Exception] NullReferenceException: Object reference not set to an instance of an object
GameObjectInspector.ClearPreviewCache() /home/builduser/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:211
GameObjectInspector.OnDisable() /home/builduser/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:199
AssetDatabase.Refresh()

PluginContainer.Initialize() Assets/3rdParty/Ludiq/Ludiq.PeekCore/Editor/Plugins/PluginContainer.cs:84
82: }
-->84: AssetDatabase.Refresh();
6: initializing = true;

Ludiq.PeekCore.PluginContainer..cctor() Assets/3rdParty/Ludiq/Ludiq.PeekCore/Editor/Plugins/PluginContainer.cs:23
21: else
22: {
-->23: Initialize();
24: }
25: }
EditorAssemblies.ProcessInitializeOnLoadAttributes()

Unity Version:
Peek Version:

Duplicates 1

Working on Fix

Hi MostHated,

Thanks for the report and sorry about the issue.

I've noticed it once or twice too, but although it seems perfectly harmless, it's annoying.

Usually I can get rid of it by restarting Unity.

Interestingly, it seems to be coming from within an internal Unity class. I'll have to look into why that might be and maybe report it to Unity.

Good deal. Yeah, I have yet to see any sort of issue resulting from it, as you mentioned, it just seemed annoying as I like to keep a clear log, lol.

I did want to add that I also receive this one, which seems similar, not nearly as often, but shows up as an actual error in my inspector (red instead of blue). It looks like similar things were the cause, but not quite sure why this one shows as an error instead.

[Error] MonoScriptImporterInspector.OnEnable must call base.OnEnable to avoid unexpected behaviour.
UnityEditor.AssetDatabase:Refresh()
PluginContainer.Initialize() Assets/3rdParty/Ludiq/Ludiq.PeekCore/Editor/Plugins/PluginContainer.cs:84
82: }
-->84: AssetDatabase.Refresh();
86: initializing = true;

Ludiq.PeekCore.PluginContainer..cctor() Assets/3rdParty/Ludiq/Ludiq.PeekCore/Editor/Plugins/PluginContainer.cs:23
21: else
22: {
-->23: Initialize();
24: }
25: }
EditorAssemblies.ProcessInitializeOnLoadAttributes()

Should add this is Ver1.0.1 on a Mac and happens when object is selected in scene view or hierarchy and  toolbar shows. Play works fine when no objects selected.

+1
Pending Review

Hi William,

Thanks for the report, it seems like that is indeed the reproduction step! Will help me find the cause and fix, hopefully. I'll ping back when I find something.

As far as bugs go, not a biggie, ha.

Hi everyone,

So it seems like Unity doesn't like Peek calling AssetDatabase.Refresh from [InitializeOnLoad]. Thankfully it doesn't seem required for the plugin to work properly, so I'm just removing that line in the next version.