From bffb556f0c98f800fe9736abea85b52f385fabcb Mon Sep 17 00:00:00 2001 From: goat Date: Thu, 3 Nov 2022 18:46:23 +0100 Subject: [PATCH] fix: check for null InternalName --- Dalamud/Interface/Internal/Windows/PluginImageCache.cs | 9 ++++++++- Dalamud/Plugin/Internal/PluginManager.cs | 6 ++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Dalamud/Interface/Internal/Windows/PluginImageCache.cs b/Dalamud/Interface/Internal/Windows/PluginImageCache.cs index d9e15abea..df2aa5422 100644 --- a/Dalamud/Interface/Internal/Windows/PluginImageCache.cs +++ b/Dalamud/Interface/Internal/Windows/PluginImageCache.cs @@ -228,13 +228,20 @@ internal class PluginImageCache : IDisposable, IServiceType /// True if an entry exists, may be null if currently downloading. public bool TryGetIcon(LocalPlugin? plugin, PluginManifest manifest, bool isThirdParty, out TextureWrap? iconTexture) { + iconTexture = null; + + if (manifest == null || manifest.InternalName == null) + { + Log.Error("THIS SHOULD NEVER HAPPEN! manifest == null || manifest.InternalName == null"); + return false; + } + if (!this.pluginIconMap.TryAdd(manifest.InternalName, null)) { iconTexture = this.pluginIconMap[manifest.InternalName]; return true; } - iconTexture = null; var requestedFrame = Service.GetNullable()?.FrameCount ?? 0; Task.Run(async () => { diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs index 2daee9d90..06cb52845 100644 --- a/Dalamud/Plugin/Internal/PluginManager.cs +++ b/Dalamud/Plugin/Internal/PluginManager.cs @@ -838,6 +838,12 @@ Thanks and have fun!"; LocalPlugin plugin; + if (manifest != null && manifest.InternalName == null) + { + Log.Error("{FileName}: Your manifest has no internal name set! Can't load this.", dllFile.FullName); + throw new Exception("No internal name"); + } + if (isDev) { Log.Information($"Loading dev plugin {name}");