[1.190] Accessing ITerminalProperty<Color>.GetValue() Throws Exception

Zach Hembree shared this bug 19 months ago

Hello, I'm the author of a mod called Build Vision 2 which is a custom control panel mod that accesses the boolean, float and color properties (ITerminalProperty) of a given IMyTerminalBlock. In version 1.190 of the game, if I attempt to access the value of a certain color property using ITerminalProperty.GetValue(), the exception below is thrown. This exception isn't thrown on all terminal blocks with a MyMultiTextPanelComponent, like cockpits and flight seats, but if I try to access that property on a cryopod or a passenger seat or god knows what else, it'll throw an exception.

I'm virtually certain that this isn't my doing, but just in case, the source code for the mod can be found below. The properties list is first retrieved at PropertyBlock.GetScrollableProps() in PropertyBlock.cs where my brilliant (moronic) workaround can be found. I basically just decided to intentionally trigger an exception by calling GetValue() in order to find out if I had one of these evil color properties on my hands.

Mod Source: https://github.com/ZachHembree/BuildVision2/tree/master/BuildVision2/Data/Scripts/BuildVision2

[04/08/2019 19:06:12:612] Build Vision has crashed!

System.NullReferenceException: Object reference not set to an instance of an object.

at Sandbox.Game.Entities.Blocks.MyMultiTextPanelComponent.<>c__13`1.<CreateTerminalControls>b__13_40(T x)

at DarkHelmet.BuildVision2.PropertyBlock.ColorProperty.<>c__DisplayClass13_0.<GetColorProperties>b__0()

at DarkHelmet.BuildVision2.PropertyBlock.ColorProperty.GetValue()

at DarkHelmet.BuildVision2.PropertiesMenu.ApiHud.UpdateText()

at DarkHelmet.BuildVision2.PropertiesMenu.ApiHud.Update(Int32 index, Int32 selection)

at DarkHelmet.BuildVision2.PropertiesMenu.Update(Boolean forceFallbackHud)

at DarkHelmet.BuildVision2.BvMain.Update()

at DarkHelmet.BuildVision2.BuildVision2.UpdateAfterSimulation()

Comments (1)


Hello, Engineer!

Thank you for your feedback! Your topic has been added between considered issues.

Please keep voting for the issue as it will help us to identify the most serious bugs.

We really appreciate your patience.

Kind Regards

Keen Software House: QA Department