Merge pull request #582 from daemitus/hotfix

api3 plugins will have a null AssemblyName value, needs handling during removal
This commit is contained in:
goaaats 2021-09-22 15:56:26 +02:00 committed by GitHub
commit 7f6f1d35d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -159,7 +159,7 @@ namespace Dalamud.Plugin.Internal
/// Gets the AssemblyName plugin, populated during <see cref="Load(PluginLoadReason, bool)"/>. /// Gets the AssemblyName plugin, populated during <see cref="Load(PluginLoadReason, bool)"/>.
/// </summary> /// </summary>
/// <returns>Plugin type.</returns> /// <returns>Plugin type.</returns>
public AssemblyName AssemblyName { get; private set; } = null; public AssemblyName? AssemblyName { get; private set; } = null;
/// <summary> /// <summary>
/// Gets the plugin name, directly from the plugin or if it is not loaded from the manifest. /// Gets the plugin name, directly from the plugin or if it is not loaded from the manifest.

View file

@ -545,7 +545,7 @@ namespace Dalamud.Plugin.Internal
} }
catch (InvalidPluginException) catch (InvalidPluginException)
{ {
PluginLocations.Remove(plugin.AssemblyName.FullName); PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty);
throw; throw;
} }
catch (BannedPluginException) catch (BannedPluginException)
@ -569,7 +569,7 @@ namespace Dalamud.Plugin.Internal
} }
else else
{ {
PluginLocations.Remove(plugin.AssemblyName.FullName); PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty);
throw; throw;
} }
} }
@ -589,7 +589,7 @@ namespace Dalamud.Plugin.Internal
throw new InvalidPluginOperationException($"Unable to remove {plugin.Name}, not unloaded"); throw new InvalidPluginOperationException($"Unable to remove {plugin.Name}, not unloaded");
this.InstalledPlugins = this.InstalledPlugins.Remove(plugin); this.InstalledPlugins = this.InstalledPlugins.Remove(plugin);
PluginLocations.Remove(plugin.AssemblyName.FullName); PluginLocations.Remove(plugin.AssemblyName?.FullName ?? string.Empty);
this.NotifyInstalledPluginsChanged(); this.NotifyInstalledPluginsChanged();
this.NotifyAvailablePluginsChanged(); this.NotifyAvailablePluginsChanged();