From 2410466de26172adfb0882815e2c44a27e98a04c Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Thu, 2 May 2024 10:37:24 +0200 Subject: [PATCH] add extra null checks --- .../SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp b/Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp index 09af1270..be45c57f 100644 --- a/Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp +++ b/Source/SenseGlove/Private/SenseGlove/SGHeadMountDisplay.cpp @@ -41,7 +41,7 @@ FName FSGHeadMountDisplay::GetDeviceName() { - if (GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) + if (GEngine && GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) { const IHeadMountedDisplay* Device{GEngine->XRSystem->GetHMDDevice()}; if (Device) @@ -133,7 +133,7 @@ bool FSGHeadMountDisplay::IsHtcVivePro() if (bNameMatches) { - if (GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) + if (GEngine && GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) { IHeadMountedDisplay* Device{GEngine->XRSystem->GetHMDDevice()}; if (Device) @@ -192,7 +192,7 @@ bool FSGHeadMountDisplay::IsHtcViveFocus3() if (bNameMatches) { - if (GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) + if (GEngine && GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) { IHeadMountedDisplay* Device{GEngine->XRSystem->GetHMDDevice()}; if (Device) @@ -252,7 +252,7 @@ bool FSGHeadMountDisplay::IsHtcViveXRElite() if (bNameMatches) { - if (GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) + if (GEngine && GEngine->XRSystem.IsValid() && GEngine->XRSystem->IsHeadTrackingAllowed()) { IHeadMountedDisplay* Device{GEngine->XRSystem->GetHMDDevice()}; if (Device)