diff --git a/Dalamud/Plugin/Internal/PluginManager.cs b/Dalamud/Plugin/Internal/PluginManager.cs
index dc658792c..ac808df89 100644
--- a/Dalamud/Plugin/Internal/PluginManager.cs
+++ b/Dalamud/Plugin/Internal/PluginManager.cs
@@ -444,6 +444,11 @@ internal partial class PluginManager : IDisposable, IServiceType
continue;
var manifest = LocalPluginManifest.Load(manifestFile);
+ if (manifest == null)
+ {
+ Log.Error("Manifest for plugin at {Path} was null", dllFile.FullName);
+ continue;
+ }
if (manifest.IsTestingExclusive && this.configuration.PluginTestingOptIns!.All(x => x.InternalName != manifest.InternalName))
this.configuration.PluginTestingOptIns.Add(new PluginTestingOptIn(manifest.InternalName));
@@ -490,9 +495,20 @@ internal partial class PluginManager : IDisposable, IServiceType
{
try
{
- // Manifests are not required for devPlugins. the Plugin type will handle any null manifests.
+ // Manifests are now required for devPlugins
var manifestFile = LocalPluginManifest.GetManifestFile(dllFile);
- var manifest = manifestFile.Exists ? LocalPluginManifest.Load(manifestFile) : null;
+ if (!manifestFile.Exists)
+ {
+ Log.Information("DLL at {DllPath} has no manifest, this is no longer valid", dllFile.FullName);
+ continue;
+ }
+
+ var manifest = LocalPluginManifest.Load(manifestFile);
+ if (manifest == null)
+ {
+ Log.Information("Could not deserialize manifest for DLL at {DllPath}", dllFile.FullName);
+ continue;
+ }
if (manifest != null && manifest.InternalName.IsNullOrEmpty())
{
@@ -721,9 +737,20 @@ internal partial class PluginManager : IDisposable, IServiceType
continue;
}
- // Manifests are not required for devPlugins. the Plugin type will handle any null manifests.
+ // Manifests are now required for devPlugins
var manifestFile = LocalPluginManifest.GetManifestFile(dllFile);
- var manifest = manifestFile.Exists ? LocalPluginManifest.Load(manifestFile) : null;
+ if (!manifestFile.Exists)
+ {
+ Log.Information("DLL at {DllPath} has no manifest, this is no longer valid", dllFile.FullName);
+ continue;
+ }
+
+ var manifest = LocalPluginManifest.Load(manifestFile);
+ if (manifest == null)
+ {
+ Log.Information("Could not deserialize manifest for DLL at {DllPath}", dllFile.FullName);
+ continue;
+ }
try
{
@@ -738,7 +765,7 @@ internal partial class PluginManager : IDisposable, IServiceType
}
catch (Exception ex)
{
- Log.Error(ex, $"During devPlugin scan, an unexpected error occurred");
+ Log.Error(ex, "During devPlugin scan, an unexpected error occurred");
}
}
@@ -1274,7 +1301,7 @@ internal partial class PluginManager : IDisposable, IServiceType
/// If this plugin is being loaded at boot.
/// Don't load the plugin, just don't do it.
/// The loaded plugin.
- private async Task LoadPluginAsync(FileInfo dllFile, LocalPluginManifest? manifest, PluginLoadReason reason, bool isDev = false, bool isBoot = false, bool doNotLoad = false)
+ private async Task LoadPluginAsync(FileInfo dllFile, LocalPluginManifest manifest, PluginLoadReason reason, bool isDev = false, bool isBoot = false, bool doNotLoad = false)
{
var name = manifest?.Name ?? dllFile.Name;
var loadPlugin = !doNotLoad;
diff --git a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs
index d36cb585d..5d132fd9c 100644
--- a/Dalamud/Plugin/Internal/Types/LocalPlugin.cs
+++ b/Dalamud/Plugin/Internal/Types/LocalPlugin.cs
@@ -51,7 +51,7 @@ internal class LocalPlugin : IDisposable
///
/// Path to the DLL file.
/// The plugin manifest.
- public LocalPlugin(FileInfo dllFile, LocalPluginManifest? manifest)
+ public LocalPlugin(FileInfo dllFile, LocalPluginManifest manifest)
{
if (dllFile.Name == "FFXIVClientStructs.Generators.dll")
{
@@ -66,30 +66,7 @@ internal class LocalPlugin : IDisposable
// Although it is conditionally used here, we need to set the initial value regardless.
this.manifestFile = LocalPluginManifest.GetManifestFile(this.DllFile);
-
- // If the parameter manifest was null
- if (manifest == null)
- {
- this.manifest = new LocalPluginManifest()
- {
- Author = "developer",
- Name = Path.GetFileNameWithoutExtension(this.DllFile.Name),
- InternalName = Path.GetFileNameWithoutExtension(this.DllFile.Name),
- AssemblyVersion = new Version("1.0.0.0"),
- Description = string.Empty,
- ApplicableVersion = GameVersion.Any,
- DalamudApiLevel = PluginManager.DalamudApiLevel,
- IsHide = false,
- };
-
- // Save the manifest to disk so there won't be any problems later.
- // We'll update the name property after it can be retrieved from the instance.
- this.manifest.Save(this.manifestFile, "manifest was null");
- }
- else
- {
- this.manifest = manifest;
- }
+ this.manifest = manifest;
var needsSaveDueToLegacyFiles = false;
diff --git a/Dalamud/Plugin/Internal/Types/PluginDef.cs b/Dalamud/Plugin/Internal/Types/PluginDef.cs
index 049e58d7d..25cd82423 100644
--- a/Dalamud/Plugin/Internal/Types/PluginDef.cs
+++ b/Dalamud/Plugin/Internal/Types/PluginDef.cs
@@ -15,7 +15,7 @@ internal struct PluginDef
/// plugin dll file.
/// plugin manifest.
/// plugin dev indicator.
- public PluginDef(FileInfo dllFile, LocalPluginManifest? manifest, bool isDev)
+ public PluginDef(FileInfo dllFile, LocalPluginManifest manifest, bool isDev)
{
this.DllFile = dllFile;
this.Manifest = manifest;
@@ -30,7 +30,7 @@ internal struct PluginDef
///
/// Gets plugin manifest.
///
- public LocalPluginManifest? Manifest { get; init; }
+ public LocalPluginManifest Manifest { get; init; }
///
/// Gets a value indicating whether plugin is a dev plugin.