Fix NRE in NHSupernovaPlanetEffectController that happens with vanilla bodies (#890)

## Bug fixes

- Fixed an NRE in NHSupernovaPlanetEffectController that happens with
vanilla bodies
This commit is contained in:
xen-42 2024-06-13 13:41:41 -04:00 committed by GitHub
commit e55818bfb8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -188,7 +188,11 @@ namespace NewHorizons.Components.Props
{
for (int i = 0; i < _ambientLight.Length; i++)
{
_ambientLight[i].intensity = _ambientLightOrigIntensity[i] * (1f - collapseProgress);
var ambientLight = _ambientLight[i];
if (ambientLight != null)
{
ambientLight.intensity = _ambientLightOrigIntensity[i] * (1f - collapseProgress);
}
}
}