From 8638fa696b0ae56911cd61d0db8661ba80a3420d Mon Sep 17 00:00:00 2001 From: JonnyOThan Date: Mon, 15 May 2023 11:01:59 -0400 Subject: [PATCH] avoid NRE on flight startup because it's possible for OnUpdate to be called before Start --- .../Auxiliary modules/JSISwitchableVariableLabel.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RasterPropMonitor/Auxiliary modules/JSISwitchableVariableLabel.cs b/RasterPropMonitor/Auxiliary modules/JSISwitchableVariableLabel.cs index ec96555d..e8766d42 100644 --- a/RasterPropMonitor/Auxiliary modules/JSISwitchableVariableLabel.cs +++ b/RasterPropMonitor/Auxiliary modules/JSISwitchableVariableLabel.cs @@ -69,9 +69,9 @@ public override void OnLoad(ConfigNode node) moduleConfig.Node = node; } - public void Start() + public override void OnAwake() { - if (HighLogic.LoadedSceneIsEditor) + if (!HighLogic.LoadedSceneIsFlight) { return; }