Skip to content

Commit

Permalink
[OneBot] qwq
Browse files Browse the repository at this point in the history
  • Loading branch information
pk5ls20 committed Oct 30, 2024
1 parent f091e3e commit 15e1776
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSer
JsonTokenType.True => true,
JsonTokenType.False => false,
JsonTokenType.String when Utf8Parser.TryParse(reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan, out bool value, out _) => value,
JsonTokenType.String when Utf8Parser.TryParse(reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan, out int intValue, out _) && intValue == 0 => false,
JsonTokenType.String when Utf8Parser.TryParse(reader.HasValueSequence ? reader.ValueSequence.ToArray() : reader.ValueSpan, out int intValue, out _) => intValue != 0,
JsonTokenType.Number when reader.TryGetInt32(out int val) => Convert.ToBoolean(val),
_ => throw new JsonException()
};
Expand Down

0 comments on commit 15e1776

Please sign in to comment.