Do not allow selecting non existent character slots.

This fixes #2176
This commit is contained in:
Pieter-Jan Briers
2020-10-07 18:03:50 +02:00
parent 882ed619fd
commit bb35845a59

View File

@@ -66,6 +66,12 @@ namespace Content.Server.Preferences
var curPrefs = prefsData.Prefs!;
if (!curPrefs.Characters.ContainsKey(index))
{
// Non-existent slot.
return;
}
prefsData.Prefs = new PlayerPreferences(curPrefs.Characters, index);
if (ShouldStorePrefs(message.MsgChannel.AuthType))