Skip to content

Commit

Permalink
Add ArgumentException check type can be assigned
Browse files Browse the repository at this point in the history
  • Loading branch information
ionite34 committed Jul 22, 2024
1 parent 196f0af commit 2d764ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dalamud/Configuration/PluginConfigurations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ public T LoadForType<T>(string pluginName) where T : IPluginConfiguration
/// <returns>Plugin Configuration.</returns>
public IPluginConfiguration? LoadForType(string pluginName, Type type)
{
if (!typeof(IPluginConfiguration).IsAssignableFrom(type))
throw new ArgumentException("Type must be assignable to IPluginConfiguration.", nameof(type));

if (this.GetConfigFile(pluginName) is not { Exists: true } path)
return null;

Expand Down

0 comments on commit 2d764ae

Please sign in to comment.