From 88ab6f3bd2b0109aee59288fe572f073e2423dfa Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 27 Aug 2020 13:59:29 +0900 Subject: [PATCH] Fix NRE when clearing loaded craft --- Source/GUI/BuildWindow.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/GUI/BuildWindow.cs b/Source/GUI/BuildWindow.cs index 2932c668..67033771 100644 --- a/Source/GUI/BuildWindow.cs +++ b/Source/GUI/BuildWindow.cs @@ -743,6 +743,10 @@ void WindowGUI (int windowID) break; case ELBuildControl.State.Planning: SelectCraft (); + if (control.state != ELBuildControl.State.Planning) { + // the loaded craft was cleared + break; + } SelectedCraft (); if (control.lockedParts) { resScroll.Begin ();