Browse Source

Add check for null or whitespace string, lint whitespace

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

+ 3
- 1
src/Discord.Net.Core/Utils/TokenUtils.cs View File

@@ -28,6 +28,9 @@ namespace Discord
/// </returns>
internal static bool CheckBotTokenValidity(string message)
{
if (string.IsNullOrWhiteSpace(message))
return false;

// split each component of the JWT
var segments = message.Split('.');

@@ -91,6 +94,5 @@ namespace Discord
throw new ArgumentException(message: "Unrecognized TokenType.", paramName: nameof(token));
}
}

}
}

Loading…
Cancel
Save