fix: Adds boolean support for Server.TryParse (#1605)

This commit is contained in:
mdodkins 2023-11-21 20:21:59 +00:00 • committed by GitHub
parent 03f850fe03
commit e680bdb4b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 0 deletions

View file

@ -187,6 +187,17 @@ namespace Server
return null;
}
if (IsType(type, OfBool))
{
if (bool.TryParse(value, out bool parsed))
{
constructed = parsed;
return null;
}
return "Not a valid boolean string.";
}
if (value.StartsWithOrdinal("0x") && IsNumeric(type))
{
try