From a712ec67566771f401145539117f54cd460df26a Mon Sep 17 00:00:00 2001 From: Joonas Rikkonen Date: Fri, 20 Jul 2018 09:53:31 +0300 Subject: [PATCH] Fixed null reference exception when trying to dispose a sub with no preview image. Closes #503 --- Barotrauma/BarotraumaShared/Source/Map/Submarine.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs b/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs index d291304b5..0568cfcd4 100644 --- a/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs +++ b/Barotrauma/BarotraumaShared/Source/Map/Submarine.cs @@ -1312,7 +1312,7 @@ namespace Barotrauma { savedSubmarines.Remove(this); #if CLIENT - PreviewImage.Remove(); + PreviewImage?.Remove(); PreviewImage = null; #endif }