MechJeb2

MechJeb2

4M Downloads

Broken MJ windows / nullref over sun

Starwaster opened this issue ยท 0 comments

commented

Any MJ window reporting biome info will go completely blank and the log flooded with with NullReference errors:

NullReferenceException: Object reference not set to an instance of an object
at MuMech.MechJebModuleInfoItems.CurrentBiome () <0x00096>
at (wrapper dynamic-method) System.Runtime.CompilerServices.ExecutionScope.lambda_method (System.Runtime.CompilerServices.ExecutionScope,object) <0x0002b>
at MuMech.ValueInfoItem/<ValueInfoItem>c__AnonStoreyA.<>m__40 () <0x00019>
at MuMech.ValueInfoItem.DrawItem () <0x00015>
at MuMech.MechJebModuleCustomInfoWindow.WindowGUI (int) <0x000a6>
at UnityEngine.GUILayout/LayoutedWindow.DoWindow (int) <0x000bb>
at UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI/WindowFunction,int,UnityEngine.GUISkin,int,single,single,UnityEngine.GUIStyle) <0x00107>

Suggested fix: (I'll try this myself if nobody picks up this issue before the weekend)

            string biome;
            try
            {
                biome = mainBody.BiomeMap.GetAtt (vessel.latitude * Math.PI / 180d, vessel.longitude * Math.PI / 180d).name;
            }
            catch (exception e)
            {
                biome = "";
            }