1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 18:07:23 +08:00

Use ArgumentException.ThrowIfNullOrEmpty throw helper

This commit is contained in:
Berkan Diler 2024-03-05 10:20:57 +01:00
parent a891303484
commit 5965db4fd7
2 changed files with 3 additions and 4 deletions

View File

@ -80,8 +80,7 @@ namespace osu.Game.IO
public override Storage GetStorageForDirectory(string path) public override Storage GetStorageForDirectory(string path)
{ {
if (string.IsNullOrEmpty(path)) ArgumentException.ThrowIfNullOrEmpty(path);
throw new ArgumentException("Must be non-null and not empty string", nameof(path));
if (!path.EndsWith(Path.DirectorySeparatorChar)) if (!path.EndsWith(Path.DirectorySeparatorChar))
path += Path.DirectorySeparatorChar; path += Path.DirectorySeparatorChar;

View File

@ -39,8 +39,8 @@ namespace osu.Game.Online.API
internal void AuthenticateWithLogin(string username, string password) internal void AuthenticateWithLogin(string username, string password)
{ {
if (string.IsNullOrEmpty(username)) throw new ArgumentException("Missing username."); ArgumentException.ThrowIfNullOrEmpty(username);
if (string.IsNullOrEmpty(password)) throw new ArgumentException("Missing password."); ArgumentException.ThrowIfNullOrEmpty(password);
var accessTokenRequest = new AccessTokenRequestPassword(username, password) var accessTokenRequest = new AccessTokenRequestPassword(username, password)
{ {