diff options
Diffstat (limited to 'src/zencore/sentryintegration.cpp')
| -rw-r--r-- | src/zencore/sentryintegration.cpp | 8 |
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); |