Changed exception check in FilterStringKeyValue

To check for invalid argument conditions
This commit is contained in:
thesupersoup 2019-06-24 01:45:10 -07:00
parent fdc5b49587
commit efd2fa2291

View File

@ -54,16 +54,14 @@ namespace Steamworks.Data
if ( string.IsNullOrEmpty( nKey ) ) if ( string.IsNullOrEmpty( nKey ) )
throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( nKey ) ); throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( nKey ) );
if ( nKey.Length <= SteamMatchmaking.MaxLobbyKeyLength ) if ( nKey.Length > SteamMatchmaking.MaxLobbyKeyLength )
{ throw new System.ArgumentException( "Key length is longer than MaxLobbyKeyLength", nameof( nKey ) );
stringFilter = new MatchMakingKeyValuePair_t stringFilter = new MatchMakingKeyValuePair_t
{ {
Key = nKey, Key = nKey,
Value = nValue Value = nValue
}; };
}
else
throw new System.ArgumentException( "Key length is longer than MaxLobbyKeyLength", nameof( nKey ) );
return this; return this;
} }