magico13 / StageRecovery

NOTE Now maintained at https://github.com/linuxgurugamer/StageRecovery An addon for Kerbal Space Program that recovers funds from spent stages.
28 stars 18 forks source link

NRE's popping during game loading screen until save game is actually loaded #36

Open cgruber opened 8 years ago

cgruber commented 8 years ago

The following exception is thrown at around 50 times per second until a game is actually loaded.

[EXC 14:53:44.657] NullReferenceException: Object reference not set to an instance of an object
    StageRecovery.StageRecovery.OnDraw ()
    StageRecovery.StageRecovery.OnGUI ()

Not sure which line it's on, but obviously it's expecting something that doesn't exist until the game is actually initialized.

magico13 commented 8 years ago

I'll look into it. KSP 1.1.2 had a few changes that a recompile of my other mods fixed, so it's probably something minor like that. Thanks for the heads up.

cgruber commented 8 years ago

No worries. The only issue is a slight UI slowdown during load - it doesn't affect gameplay.

denyasis commented 5 years ago

Hello - I can confirm this error. It seems to specifically tied to the GUI settings for difficulty in the main menu. With the game set to pop-up the error msg's, that is when It appears for me.

To reproduce. Start game, new career game, and open the Difficulty settings menu. It generates two errors:

[ERR 07:19:42.822] Error calling custom Interactible method in type StageRecovery.SR2: and [ERR 07:20:37.246] Error calling custom Interactible method in type StageRecovery.SR3:

It seems to be linked to a "label" and a "slider" , but I"m not sure which one.

I'll try to come up with a way to attach the log file. Git hub says it is too large and Kate is freezing when I try to truncate it. (over 200mb written in about 5 min and about 6 million lines) Here are the repeating NRE's. the rate is about 1 every millisecond and all of them are identical to these two:

[EXC 07:19:46.347] NullReferenceException: Object reference not set to an instance of an object StageRecovery.Settings1.get_Instance () StageRecovery.SR3.Interactible (System.Reflection.MemberInfo member, .GameParameters parameters) DifficultyOptionsMenu+cAnonStorey0.<>mB () UnityEngine.Debug:LogException(Exception)

c__AnonStorey0:<>m__B() DialogGUIBase:Update() DialogGUISlider:Update() DialogGUIBase:Update() DialogGUIVerticalLayout:Update() DialogGUIBase:Update() DialogGUIVerticalLayout:Update() DialogGUIBase:Update() DialogGUIBase:Update() DialogGUIVerticalLayout:Update() DialogGUIBase:Update() MultiOptionDialog:Update() PopupDialog:Update() [ERR 07:19:46.347] Error calling custom Interactible method in type StageRecovery.SR3: [EXC 07:19:46.355] NullReferenceException: Object reference not set to an instance of an object StageRecovery.Settings1.get_Instance () StageRecovery.SR2.Interactible (System.Reflection.MemberInfo member, .GameParameters parameters) DifficultyOptionsMenu+c__AnonStorey0.<>m__B () UnityEngine.Debug:LogException(Exception) c__AnonStorey0:<>m__B() DialogGUIBase:Update() DialogGUILabel:Update() DialogGUIBase:Update() DialogGUIVerticalLayout:Update() DialogGUIBase:Update() DialogGUIVerticalLayout:Update() DialogGUIBase:Update() DialogGUIBase:Update() DialogGUIVerticalLayout:Update() DialogGUIBase:Update() MultiOptionDialog:Update() PopupDialog:Update() [ERR 07:19:46.355] Error calling custom Interactible method in type StageRecovery.SR2:
denyasis commented 5 years ago

I was able to truncate the Log file down to 72K lines. I've attached it. Thank you for your time. KSP.log