mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Add runtime error for improperly created artifacts
This commit is contained in:
@@ -50,6 +50,7 @@
|
||||
- Add unused passable func to OutputFile
|
||||
- Pass in new func for OutputFile
|
||||
- Use new func in Redumper
|
||||
- Add runtime error for improperly created artifacts
|
||||
|
||||
### 3.2.1 (2024-08-05)
|
||||
|
||||
|
||||
@@ -142,8 +142,6 @@ namespace MPF.Processors
|
||||
/// </summary>
|
||||
private readonly Func<string, bool>? _existsFunc;
|
||||
|
||||
// TODO: Add validation that a key exists if the artifact flag is present
|
||||
|
||||
/// <summary>
|
||||
/// Create an OutputFile with a single filename
|
||||
/// </summary>
|
||||
@@ -169,6 +167,10 @@ namespace MPF.Processors
|
||||
ArtifactKey = null;
|
||||
_flags = flags;
|
||||
_existsFunc = existsFunc;
|
||||
|
||||
// Ensure artifacts have a key
|
||||
if (IsArtifact && string.IsNullOrEmpty(ArtifactKey))
|
||||
throw new InvalidDataException($"{flags} should not contain the Artifact or Binary flag");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -180,6 +182,10 @@ namespace MPF.Processors
|
||||
ArtifactKey = artifactKey;
|
||||
_flags = flags;
|
||||
_existsFunc = existsFunc;
|
||||
|
||||
// Ensure artifacts have a key
|
||||
if (IsArtifact && string.IsNullOrEmpty(ArtifactKey))
|
||||
throw new InvalidDataException($"{flags} should not contain the Artifact or Binary flag");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user