From cb785a721340a5857be55a61d29de8c9579416c6 Mon Sep 17 00:00:00 2001 From: Mamadou Babaei Date: Mon, 15 Jul 2024 23:02:38 +0200 Subject: [PATCH] do not ensure as it's possible to get a nullpointer during component uninitialization --- .../Private/SenseGlove/Components/SGVirtualHandComponent.cpp | 2 +- .../Private/SenseGlove/Components/SGWristTrackerComponent.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp index 2d38b3b4..8493d685 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGVirtualHandComponent.cpp @@ -242,7 +242,7 @@ void USGVirtualHandComponent::SetVirtualHandSettingsOverrides( FSGVirtualHandSettings USGVirtualHandComponent::GetVirtualHandSettings() const { const USGSettings* Settings{USGSettings::GetInstance()}; - if (!ensureAlwaysMsgf(IsValid(Settings), TEXT("The settings subsystem has not been initialized!"))) + if (!IsValid(Settings)) { return FSGVirtualHandSettings{}; } diff --git a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp index f845edb7..e15a329c 100644 --- a/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp +++ b/Source/SenseGlove/Private/SenseGlove/Components/SGWristTrackerComponent.cpp @@ -121,7 +121,7 @@ void USGWristTrackerComponent::SetWristTrackingSettingsOverrides( FSGWristTrackingSettings USGWristTrackerComponent::GetWristTrackingSettings() const { const USGSettings* Settings{USGSettings::GetInstance()}; - if (!ensureAlwaysMsgf(IsValid(Settings), TEXT("The settings subsystem has not been initialized!"))) + if (!IsValid(Settings)) { return FSGWristTrackingSettings{}; }