mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
fix: guard against CommandInfo, Manifest ever becoming null
This commit is contained in:
parent
28e9d5f156
commit
d1c22f7dd6
3 changed files with 6 additions and 3 deletions
|
|
@ -2174,7 +2174,10 @@ internal class PluginInstallerWindow : Window, IDisposable
|
||||||
if (plugin.IsLoaded)
|
if (plugin.IsLoaded)
|
||||||
{
|
{
|
||||||
var commands = commandManager.Commands
|
var commands = commandManager.Commands
|
||||||
.Where(cInfo => cInfo.Value.ShowInHelp && cInfo.Value.LoaderAssemblyName == plugin.Manifest.InternalName)
|
.Where(cInfo =>
|
||||||
|
cInfo.Value != null &&
|
||||||
|
cInfo.Value.ShowInHelp &&
|
||||||
|
cInfo.Value.LoaderAssemblyName == plugin.Manifest.InternalName)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
if (commands.Any())
|
if (commands.Any())
|
||||||
|
|
|
||||||
|
|
@ -630,7 +630,7 @@ internal class LocalPlugin : IDisposable
|
||||||
if (manifest.Exists)
|
if (manifest.Exists)
|
||||||
{
|
{
|
||||||
// var isDisabled = this.IsDisabled; // saving the internal state because it could have been deleted
|
// var isDisabled = this.IsDisabled; // saving the internal state because it could have been deleted
|
||||||
this.Manifest = LocalPluginManifest.Load(manifest);
|
this.Manifest = LocalPluginManifest.Load(manifest) ?? throw new Exception("Could not reload manifest.");
|
||||||
// this.Manifest.Disabled = isDisabled;
|
// this.Manifest.Disabled = isDisabled;
|
||||||
|
|
||||||
this.SaveManifest();
|
this.SaveManifest();
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ internal record LocalPluginManifest : PluginManifest
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="manifestFile">Path to the manifest.</param>
|
/// <param name="manifestFile">Path to the manifest.</param>
|
||||||
/// <returns>A <see cref="PluginManifest"/> object.</returns>
|
/// <returns>A <see cref="PluginManifest"/> object.</returns>
|
||||||
public static LocalPluginManifest Load(FileInfo manifestFile) => JsonConvert.DeserializeObject<LocalPluginManifest>(File.ReadAllText(manifestFile.FullName))!;
|
public static LocalPluginManifest? Load(FileInfo manifestFile) => JsonConvert.DeserializeObject<LocalPluginManifest>(File.ReadAllText(manifestFile.FullName));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A standardized way to get the plugin DLL name that should accompany a manifest file. May not exist.
|
/// A standardized way to get the plugin DLL name that should accompany a manifest file. May not exist.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue