mirror of https://github.com/ppy/osu
Use ArgumentException.ThrowIfNullOrEmpty throw helper
This commit is contained in:
parent
a891303484
commit
5965db4fd7
|
@ -80,8 +80,7 @@ public override Stream GetStream(string path, FileAccess access = FileAccess.Rea
|
|||
|
||||
public override Storage GetStorageForDirectory(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
throw new ArgumentException("Must be non-null and not empty string", nameof(path));
|
||||
ArgumentException.ThrowIfNullOrEmpty(path);
|
||||
|
||||
if (!path.EndsWith(Path.DirectorySeparatorChar))
|
||||
path += Path.DirectorySeparatorChar;
|
||||
|
|
|
@ -39,8 +39,8 @@ internal OAuth(string clientId, string clientSecret, string endpoint)
|
|||
|
||||
internal void AuthenticateWithLogin(string username, string password)
|
||||
{
|
||||
if (string.IsNullOrEmpty(username)) throw new ArgumentException("Missing username.");
|
||||
if (string.IsNullOrEmpty(password)) throw new ArgumentException("Missing password.");
|
||||
ArgumentException.ThrowIfNullOrEmpty(username);
|
||||
ArgumentException.ThrowIfNullOrEmpty(password);
|
||||
|
||||
var accessTokenRequest = new AccessTokenRequestPassword(username, password)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue