Skip to content

Commit 5775029

Browse files
committed
Validate a system is provided for CLI applications
1 parent 286ec86 commit 5775029

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

CHANGELIST.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
- Update RedumpLib to 1.9.1
1515
- Split path creation in OptionsLoader
1616
- Add unused Dreamdump execution context
17+
- Validate a system is provided for CLI applications
1718

1819
### 3.6.0 (2025-11-28)
1920

MPF.CLI/Features/BaseFeature.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ protected BaseFeature(string name, string[] flags, string description, string? d
9797
/// <inheritdoc/>
9898
public override bool Execute()
9999
{
100+
// Validate a system type is provided
101+
if (System == null)
102+
{
103+
Console.Error.WriteLine("A system name needs to be provided");
104+
return false;
105+
}
106+
100107
// Validate the supplied credentials
101108
if (Options.RetrieveMatchInformation
102109
&& !string.IsNullOrEmpty(Options.RedumpUsername)

MPF.Check/Features/BaseFeature.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ protected BaseFeature(string name, string[] flags, string description, string? d
7272
/// <inheritdoc/>
7373
public override bool Execute()
7474
{
75+
// Validate a system type is provided
76+
if (System == null)
77+
{
78+
Console.Error.WriteLine("A system name needs to be provided");
79+
return false;
80+
}
81+
82+
// Validate a program is provided
7583
if (Options.InternalProgram == InternalProgram.NONE)
7684
{
7785
Console.Error.WriteLine("A program name needs to be provided");

0 commit comments

Comments
 (0)