linuxgurugamer / KCT

Kerbal Construction Time - An addon for Kerbal Space Program
GNU General Public License v3.0
11 stars 15 forks source link

NRE when leaving Editor #84

Closed GarwelGarwel closed 1 year ago

GarwelGarwel commented 3 years ago

I encountered this issue after loading up a saved vessel in SPH, ordering it to be built and then trying to exit the Editor. The NRE apparently prevents the Editor from closing and I can't get back to KSC scene. Deleting the vessel or switching between SPH and VAB doesn't help either.

Unfortunately, I run with lots of mods and it's hard to pinpoint how exactly it happened (this is the first time such a thing occurred). But with NREs I guess it shouldn't be hard to add a null check. It seems to be somewhere in this method.

Error message:

[EXC 10:12:19.000] NullReferenceException: Object reference not set to an instance of an object
    ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) (at <06f13185617646e5bc801baeab53ab75>:0)
    ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) (at <06f13185617646e5bc801baeab53ab75>:0)
    ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) (at <06f13185617646e5bc801baeab53ab75>:0)
    ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) (at <06f13185617646e5bc801baeab53ab75>:0)
    ConfigNode.CopyTo (ConfigNode node) (at <06f13185617646e5bc801baeab53ab75>:0)
    KerbalConstructionTime.KCT_KSC.AsConfigNode () (at <a3fb6e879a9b4f188b2647fe67c2cc5a>:0)
    KerbalConstructionTime.KerbalConstructionTimeData.OnSave (ConfigNode node) (at <a3fb6e879a9b4f188b2647fe67c2cc5a>:0)
    ScenarioModule.Save (ConfigNode node) (at <06f13185617646e5bc801baeab53ab75>:0)
    ProtoScenarioModule..ctor (ScenarioModule module) (at <06f13185617646e5bc801baeab53ab75>:0)
    ScenarioRunner.UpdateModules () (at <06f13185617646e5bc801baeab53ab75>:0)
    ScenarioRunner.GetUpdatedProtoModules () (at <06f13185617646e5bc801baeab53ab75>:0)
    Game.Updated (GameScenes startSceneOverride) (at <06f13185617646e5bc801baeab53ab75>:0)
    GamePersistence.SaveGame (System.String saveFileName, System.String saveFolder, SaveMode saveMode, GameScenes startScene) (at <06f13185617646e5bc801baeab53ab75>:0)
    GamePersistence.SaveGame (System.String saveFileName, System.String saveFolder, SaveMode saveMode) (at <06f13185617646e5bc801baeab53ab75>:0)
    EditorLogic.onExitConfirm () (at <06f13185617646e5bc801baeab53ab75>:0)
    EditorLogic.onExitContinue () (at <06f13185617646e5bc801baeab53ab75>:0)
    EditorLogic.exitEditor () (at <06f13185617646e5bc801baeab53ab75>:0)
    UnityEngine.Events.InvokableCall.Invoke () (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.Events.UnityEvent.Invoke () (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.UI.Button.Press () (at <8485d97123094db9883b53b3349c2a3b>:0)
    UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at <8485d97123094db9883b53b3349c2a3b>:0)
    UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at <8485d97123094db9883b53b3349c2a3b>:0)
    UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at <8485d97123094db9883b53b3349c2a3b>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.EventSystems.EventSystem:Update()
linuxgurugamer commented 3 years ago

Per usual, a snippit is useless. There are too many places to be able to identify the problem in most cases. I need a full log file (Player.log). Also, were you playing RO or the regular? Again, this information would be in the log file

GarwelGarwel commented 3 years ago

Here you go

I'm playing without RO, but with many other mods. I also noticed that ClickThroughBlocker throws some exceptions.

linuxgurugamer commented 1 year ago

I know this reply is 2 years late, sorry.

Was going over old issues, this one seems to be fixed. I tested it, didn't get the error, and when I looked at the code, there is a try/catch in the method If it happens again, please open a new ticket, thanks