NRE in DBS GUI if there are no powerConsumers
Closed this issue · 3 comments
blackliner commented
Hi Chris,
one of those 2 lines is throwing NRE's if there are no consumers:
Errors from KSP.log:
NullReferenceException: Object reference not set to an instance of an object
at DynamicBatteryStorage.DynamicBatteryStorageUI.PowerWindow (Int32 windowId) [0x00000] in :0
at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x00000] in :0(Filename: Line: -1)
GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)
(Filename: Line: 422)
Reproduce:
- Launch a new vessel with only one part (any probecore will do)
- open GUI (CTRL + SHIFT + k)
- warp >= 100
blackliner commented
I think this also happens if there are no producers.
ChrisAdderley commented
I'll make sure this is resolved during refactoring
ChrisAdderley commented
Resolved!