Fixed null reference exception when trying to dispose a sub with no preview image. Closes #503

This commit is contained in:
Joonas Rikkonen
2018-07-20 09:53:31 +03:00
parent e1539b76cd
commit a712ec6756
@@ -1312,7 +1312,7 @@ namespace Barotrauma
{ {
savedSubmarines.Remove(this); savedSubmarines.Remove(this);
#if CLIENT #if CLIENT
PreviewImage.Remove(); PreviewImage?.Remove();
PreviewImage = null; PreviewImage = null;
#endif #endif
} }