fix: check for null InternalName

This commit is contained in:
goat 2022-11-03 18:46:23 +01:00
parent 83c16146aa
commit bffb556f0c
No known key found for this signature in database
GPG key ID: 49E2AA8C6A76498B
2 changed files with 14 additions and 1 deletions

View file

@ -228,13 +228,20 @@ internal class PluginImageCache : IDisposable, IServiceType
/// <returns>True if an entry exists, may be null if currently downloading.</returns>
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<DalamudInterface>.GetNullable()?.FrameCount ?? 0;
Task.Run(async () =>
{

View file

@ -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}");