From 1e8c1f7f04192c7172ba5849624acd6168e4fe5b Mon Sep 17 00:00:00 2001 From: Alex Noir Date: Tue, 5 Dec 2017 16:17:51 +0300 Subject: [PATCH] Fixed a NullReferenceException caused when you try to play a round with traitors enabled while there are not enough player characters. --- .../Source/GameSession/GameModes/TraitorManager.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/TraitorManager.cs b/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/TraitorManager.cs index 8c201805d..e3d4790c5 100644 --- a/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/TraitorManager.cs +++ b/Barotrauma/BarotraumaShared/Source/GameSession/GameModes/TraitorManager.cs @@ -69,7 +69,7 @@ namespace Barotrauma get { return traitorList; } } - private List traitorList; + private List traitorList = new List(); public string codeWords, codeResponse; @@ -112,7 +112,6 @@ namespace Barotrauma codeWords = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt); codeResponse = ToolBox.GetRandomLine(wordsTxt) + ", " + ToolBox.GetRandomLine(wordsTxt); - traitorList = new List(); while (TraitorCount-- >= 0) { if (traitorCandidates.Count <= 0)