Reject undefined numeric LogLevel values (#390)

This commit is contained in:
kadu04t
2026-07-18 09:47:19 -03:00
committed by GitHub
parent e6be48a390
commit 5309f384cf
2 changed files with 42 additions and 1 deletions
+3 -1
View File
@@ -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;
}