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,17 +54,15 @@ public LobbyQuery FilterStringKeyValue( string nKey, string nValue )
if ( string.IsNullOrEmpty( nKey ) )
throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( nKey ) );
if ( nKey.Length <= SteamMatchmaking.MaxLobbyKeyLength )
{
stringFilter = new MatchMakingKeyValuePair_t
{
Key = nKey,
Value = nValue
};
}
else
if ( nKey.Length > SteamMatchmaking.MaxLobbyKeyLength )
throw new System.ArgumentException( "Key length is longer than MaxLobbyKeyLength", nameof( nKey ) );
stringFilter = new MatchMakingKeyValuePair_t
{
Key = nKey,
Value = nValue
};
return this;
}
#endregion