From f469041363ea72e8da6f9bda7ea7cfceadcd00a1 Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Sun, 11 Jun 2017 18:49:48 +0300 Subject: [PATCH] Fixed exceptions in NetLobbyScreen.UpdatePlayerFrame if job preferences contain jobs that aren't in the list of job prefabs --- Barotrauma/Source/Screens/NetLobbyScreen.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Barotrauma/Source/Screens/NetLobbyScreen.cs b/Barotrauma/Source/Screens/NetLobbyScreen.cs index 8d1ea20ff..e4e8a2ad7 100644 --- a/Barotrauma/Source/Screens/NetLobbyScreen.cs +++ b/Barotrauma/Source/Screens/NetLobbyScreen.cs @@ -542,8 +542,11 @@ namespace Barotrauma int i = 1; foreach (string jobName in GameMain.Config.JobNamePreferences) { - JobPrefab job = JobPrefab.List.First(x => x.Name == jobName); - if (job == null) { continue; } + JobPrefab job = JobPrefab.List.Find(x => x.Name == jobName); + if (job == null) + { + continue; + } GUITextBlock jobText = new GUITextBlock(new Rectangle(0, 0, 0, 20), i + ". " + job.Name + " ", "", Alignment.Left, Alignment.Right, jobList, false,