aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/sentryintegration.cpp
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2026-03-18 10:10:50 +0100
committerGitHub Enterprise <[email protected]>2026-03-18 10:10:50 +0100
commit0faf85c9d83c85c18aa72e19458356bf9e45c59b (patch)
tree1c2aba035aafa8526a5b8e28e2b0429099b84ef4 /src/zencore/sentryintegration.cpp
parentfix for GHES failing on upload-artifacts@v3 (#856) (diff)
downloadzen-0faf85c9d83c85c18aa72e19458356bf9e45c59b.tar.xz
zen-0faf85c9d83c85c18aa72e19458356bf9e45c59b.zip
bugfix release - v5.7.23 (#851)
Works around issue where we could crash during startup when the logging system wasn't fully initialized and something used `ZEN_INFO` et al
Diffstat (limited to 'src/zencore/sentryintegration.cpp')
-rw-r--r--src/zencore/sentryintegration.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp
index b7d01003b..634045cfb 100644
--- a/src/zencore/sentryintegration.cpp
+++ b/src/zencore/sentryintegration.cpp
@@ -248,6 +248,14 @@ SentryIntegration::Initialize(const Config& Conf, const std::string& CommandLine
}
sentry_options_t* SentryOptions = sentry_options_new();
+ if (SentryOptions == nullptr)
+ {
+ // OOM — skip sentry entirely rather than crashing on the subsequent set calls
+ m_SentryErrorCode = -1;
+ m_IsInitialized = true;
+ return;
+ }
+
sentry_options_set_dsn(SentryOptions, Conf.Dsn.empty() ? sentry::DefaultDsn.c_str() : Conf.Dsn.c_str());
sentry_options_set_database_path(SentryOptions, SentryDatabasePath.c_str());
sentry_options_set_logger(SentryOptions, SentryLogFunction, this);