fix: Adds boolean support for Server.TryParse (#1605)
This commit is contained in:
parent
03f850fe03
commit
e680bdb4b5
2 changed files with 34 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue