Browse Source

Use ToString in converter instead of boxing-cast

In cases where Discord sent a value of `id=0`, this would throw an invalid-cast, where 0u64 cannot be cast to string.
tags/1.0-rc
Christopher F 8 years ago
parent
commit
9725dcec24
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/Discord.Net.Core/Net/Converters/NullableUInt64Converter.cs

+ 1
- 1
src/Discord.Net.Core/Net/Converters/NullableUInt64Converter.cs View File

@@ -16,7 +16,7 @@ namespace Discord.Net.Converters
{
object value = reader.Value;
if (value != null)
return ulong.Parse((string)value, NumberStyles.None, CultureInfo.InvariantCulture);
return ulong.Parse(value.ToString(), NumberStyles.None, CultureInfo.InvariantCulture);
else
return null;
}


Loading…
Cancel
Save