mirror of
https://github.com/Facepunch/Facepunch.Steamworks.git
synced 2024-12-28 15:45:29 +03:00
Changed exception check in FilterStringKeyValue
To check for invalid argument conditions
This commit is contained in:
parent
fdc5b49587
commit
efd2fa2291
@ -54,17 +54,15 @@ public LobbyQuery FilterStringKeyValue( string nKey, string nValue )
|
|||||||
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 )
|
||||||
{
|
|
||||||
stringFilter = new MatchMakingKeyValuePair_t
|
|
||||||
{
|
|
||||||
Key = nKey,
|
|
||||||
Value = nValue
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
throw new System.ArgumentException( "Key length is longer than MaxLobbyKeyLength", nameof( nKey ) );
|
throw new System.ArgumentException( "Key length is longer than MaxLobbyKeyLength", nameof( nKey ) );
|
||||||
|
|
||||||
|
stringFilter = new MatchMakingKeyValuePair_t
|
||||||
|
{
|
||||||
|
Key = nKey,
|
||||||
|
Value = nValue
|
||||||
|
};
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
Loading…
Reference in New Issue
Block a user