From 34f308ac481d29b782b8496e6f7d550b76101800 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Thu, 4 Jul 2024 22:14:34 +0200 Subject: [PATCH] Fix crash in setCrashReporterEnabled --- .../src/crash-handler/CrashHandlerBackend_Crashpad.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp b/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp index 1b93ebecb4f..70b0189f296 100644 --- a/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp +++ b/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp @@ -457,6 +457,11 @@ bool startCrashHandler(std::string appPath, std::string crashURL, std::string cr } void setCrashReportingEnabled(bool enabled) { + if (!crashpadDatabase) { + qCCritical(crash_handler) << "Can't set to enabled, crash handler not initialized!"; + return; + } + auto settings = crashpadDatabase->GetSettings(); settings->SetUploadsEnabled(enabled);