Added switch to target.
[VesselSimulator.git] / KerbalEngineer / Editor / BuildOverlayVessel.cs
blob:a/KerbalEngineer/Editor/BuildOverlayVessel.cs -> blob:b/KerbalEngineer/Editor/BuildOverlayVessel.cs
--- a/KerbalEngineer/Editor/BuildOverlayVessel.cs
+++ b/KerbalEngineer/Editor/BuildOverlayVessel.cs
@@ -108,17 +108,24 @@
 
         protected void Update()
         {
-            if (!Visible || EditorLogic.startPod == null)
-            {
-                return;
-            }
-
-            if (this.openPercent > 0.0)
-            {
-                this.SetVesselInfo();
-            }
-
-            this.SetSlidePosition();
+            try
+            {
+                if (!BuildOverlay.Visible || EditorLogic.startPod == null)
+                {
+                    return;
+                }
+
+                if (this.openPercent > 0.0)
+                {
+                    this.SetVesselInfo();
+                }
+
+                this.SetSlidePosition();
+            }
+            catch (Exception ex)
+            {
+                Logger.Exception(ex);
+            }
         }
 
         #endregion