Use `Type.EmptyTypes` in `MovieImport.ImportFile`

This commit is contained in:
YoshiRulz 2024-08-21 22:15:14 +10:00
parent 4e85a71d53
commit c2a336647c
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 1 additions and 1 deletions

View File

@ -43,7 +43,7 @@ namespace BizHawk.Client.Common
var result = Importers.FirstOrNull(kvp => string.Equals(kvp.Value.Extension, ext, StringComparison.OrdinalIgnoreCase));
// Create a new instance of the importer class using the no-argument constructor
return result is { Key: var importerType }
&& importerType.GetConstructor(Array.Empty<Type>())?.Invoke(Array.Empty<object>()) is IMovieImport importer
&& importerType.GetConstructor(Type.EmptyTypes)?.Invoke(Array.Empty<object>()) is IMovieImport importer
? importer.Import(dialogParent, session, path, config)
: ImportResult.Error($"No importer found for file type {ext}");
}