Browse Source

Catch exception that can be thrown by GetString

pull/1206/head
Chris Johnston 6 years ago
parent
commit
1c249cb7e3
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      src/Discord.Net.Core/Utils/TokenUtils.cs

+ 5
- 0
src/Discord.Net.Core/Utils/TokenUtils.cs View File

@@ -47,6 +47,11 @@ namespace Discord
// discard id // discard id
return ulong.TryParse(idStr, out var id); return ulong.TryParse(idStr, out var id);
} }
catch (DecoderFallbackException)
{
// can be thrown by GetString
return false;
}
catch (FormatException) catch (FormatException)
{ {
// ignore exception, if contains invalid base64 characters return false // ignore exception, if contains invalid base64 characters return false


Loading…
Cancel
Save