Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error Spam When Opening Project #11

Open
ptlthg opened this issue Dec 7, 2023 · 3 comments
Open

Error Spam When Opening Project #11

ptlthg opened this issue Dec 7, 2023 · 3 comments

Comments

@ptlthg
Copy link

ptlthg commented Dec 7, 2023

I get the following two errors spammed in my console when opening my 4.2 project with asset placer enabled. I can't seem to reproduce these reliably, but these errors are printed every frame, so I've had to edit the code myself to stop them. (By adding a null check and a TryGetValue)

System.NullReferenceException: Object reference not set to an instance of an object.
     at AssetPlacer.AssetPlacerPlugin.SetToolTip(String text, Color[] colors) in G:\Godot\DungeonGame\addons\assetplacer\AssetPlacerPlugin.cs:line 531
     at AssetPlacer.AssetPlacerPlugin._ProcessUpdate(Double delta) in G:\Godot\DungeonGame\addons\assetplacer\AssetPlacerPlugin.cs:line 621
     at AssetPlacer.ContextlessPlugin._Process(Double delta) in G:\Godot\DungeonGame\addons\assetplacer\utils\contextlessPlugin\ContextlessPlugin.cs:line 155
     at Godot.Node.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Node.cs:line 2111
     at Godot.EditorPlugin.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharpEditor/Generated/GodotObjects/EditorPlugin.cs:line 1352
     at AssetPlacer.ContextlessPlugin.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in G:\Godot\DungeonGame\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\AssetPlacer.ContextlessPlugin_ScriptMethods.generated.cs:line 250
     at AssetPlacer.AssetPlacerPlugin.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in G:\Godot\DungeonGame\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\AssetPlacer.AssetPlacerPlugin_ScriptMethods.generated.cs:line 440
     at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24
  System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
     at Godot.Collections.Dictionary`2.get_Item(TKey key) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Dictionary.cs:line 644
     at AssetPlacer.AssetPlacerUi.SetAssetBroken(String selectedAssetPath, Boolean broken) in G:\Godot\DungeonGame\addons\assetplacer\ui\AssetPlacerUi.cs:line 728
     at AssetPlacer.AssetPalette.OnPreviewLoaded(String assetPath, Variant preview) in G:\Godot\DungeonGame\addons\assetplacer\assetPalette\AssetPalette.cs:line 592
     at AssetPlacer.AssetPalette.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in G:\Godot\DungeonGame\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\AssetPlacer.AssetPalette_ScriptMethods.generated.cs:line 457
     at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24

Not sure if just adding checks is enough to fix it or if this is a symptom of a bigger issue, but I've had to replace dictionary lookups in the code for asset placer buttons with TryGetValue for the last couple of Asset Placer versions because I keep running into that error in particular.

Let me know if there's any more information you need, thanks

@CookieBadger
Copy link
Owner

Hey, thanks for reporting and I'm sorry that you had these issues. As it seems you were able to fix it for now, I'll look into this when I'll work on the next version, but please let me know if something comes up again.

@CookieBadger
Copy link
Owner

CookieBadger commented Dec 18, 2023

Hey @ptlthg I just uploaded AssetPlacer 1.2.2 which fixes at least the second issue you had. I have so far not been able to reproduce the first issue, so could you let me know, if it still appears with the upgrade, now that the initialization works properly?

@ptlthg
Copy link
Author

ptlthg commented Dec 24, 2023

Thanks for the update!

I just tried it out a bit more today. I'm not sure if it matters, but I left Godot running with the plugin in the background for a few hours and when I came back to it the same first error started spamming again in the console. The console tab was open while this was happening, and moved my mouse around to hit the clear console button also while this was still happening.

The second error hasn't happened again though, but I only used the plugin actively for maybe an hour, so I can't say for sure if it's gone.

/root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/NativeInterop/ExceptionUtils.cs:112 - System.NullReferenceException: Object reference not set to an instance of an object.
     at AssetPlacer.AssetPlacerPlugin.SetToolTip(String text, Color[] colors) in G:\Godot\DungeonGame\addons\assetplacer\AssetPlacerPlugin.cs:line 531
     at AssetPlacer.AssetPlacerPlugin._ProcessUpdate(Double delta) in G:\Godot\DungeonGame\addons\assetplacer\AssetPlacerPlugin.cs:line 621
     at AssetPlacer.ContextlessPlugin._Process(Double delta) in G:\Godot\DungeonGame\addons\assetplacer\utils\contextlessPlugin\ContextlessPlugin.cs:line 155
     at Godot.Node.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Generated/GodotObjects/Node.cs:line 2111
     at Godot.EditorPlugin.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharpEditor/Generated/GodotObjects/EditorPlugin.cs:line 1352
     at AssetPlacer.ContextlessPlugin.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in G:\Godot\DungeonGame\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\AssetPlacer.ContextlessPlugin_ScriptMethods.generated.cs:line 250
     at AssetPlacer.AssetPlacerPlugin.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in G:\Godot\DungeonGame\Godot.SourceGenerators\Godot.SourceGenerators.ScriptMethodsGenerator\AssetPlacer.AssetPlacerPlugin_ScriptMethods.generated.cs:line 440
     at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants