From 10574f9db324807f9455ebb4144b88063afd77dc Mon Sep 17 00:00:00 2001 From: Ondrej Hrusovsky Date: Wed, 13 Dec 2023 15:22:20 +0100 Subject: [PATCH] Fix possible crash when GetPlayerInput() is nullptr on startup --- .../Source/CogInput/Private/CogInputWindow_Actions.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp index 69e8f49..dca7363 100644 --- a/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp +++ b/Plugins/CogInput/Source/CogInput/Private/CogInputWindow_Actions.cpp @@ -64,6 +64,12 @@ void FCogInputWindow_Actions::RenderContent() ImGui::Text("No Enhanced Input Subsystem"); return; } + + if(EnhancedInputSubsystem->GetPlayerInput() == nullptr) + { + ImGui::Text("No Player Input"); + return; + } if (ImGui::BeginMenuBar()) { @@ -233,4 +239,4 @@ void FCogInputWindow_Actions::DrawAxis(const char* Format, const char* ActionNam ImGui::SetNextItemWidth(-1); FCogWindowWidgets::SliderWithReset("##Inject", InjectValue, -1.0f, 1.0f, 0.0f, "%0.2f"); ImGui::PopID(); -} \ No newline at end of file +}