From 746c84228da58e1198c4c4485ff73e0846b99e7c Mon Sep 17 00:00:00 2001 From: Noah Pilarski Date: Fri, 7 Jun 2024 13:51:18 -0400 Subject: [PATCH] Fix NRE in NHSupernovaPlanetEffectController --- .../Components/Props/NHSupernovaPlanetEffectController.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs b/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs index 0f87cca3..7b08bddd 100644 --- a/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs +++ b/NewHorizons/Components/Props/NHSupernovaPlanetEffectController.cs @@ -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); + } } }