Fix an NRE I just got

This commit is contained in:
Nick 2024-04-29 12:46:40 -04:00
parent a7bbbc1bd1
commit 8a983f18ce

View File

@ -14,7 +14,11 @@ internal class PlayerShipAtmosphereDetectorFix : MonoBehaviour
public void Start()
{
_fluidDetector = Locator.GetPlayerCameraDetector().GetComponent<PlayerCameraFluidDetector>();
_shipAtmosphereVolume = Locator.GetShipBody().transform.Find("Volumes/ShipAtmosphereVolume").GetComponent<SimpleFluidVolume>();
_shipAtmosphereVolume = Locator.GetShipBody()?.transform?.Find("Volumes/ShipAtmosphereVolume")?.GetComponent<SimpleFluidVolume>();
if (_shipAtmosphereVolume == null)
{
Destroy(this);
}
}
public void Update()