mirror of
https://github.com/par274/sharpemu.git
synced 2026-07-24 11:48:39 +08:00
Reject undefined numeric LogLevel values (#390)
This commit is contained in:
@@ -110,7 +110,8 @@ public static class SharpEmuLog
|
||||
}
|
||||
|
||||
var normalized = text.Trim();
|
||||
if (Enum.TryParse<LogLevel>(normalized, ignoreCase: true, out level))
|
||||
if (Enum.TryParse<LogLevel>(normalized, ignoreCase: true, out level) &&
|
||||
Enum.IsDefined(level))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -127,6 +128,7 @@ public static class SharpEmuLog
|
||||
return true;
|
||||
}
|
||||
|
||||
level = default;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user