aboutsummaryrefslogtreecommitdiff
path: root/src/zencore/sentryintegration.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zencore/sentryintegration.cpp')
-rw-r--r--src/zencore/sentryintegration.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp
index 636e182b4..bfff114c3 100644
--- a/src/zencore/sentryintegration.cpp
+++ b/src/zencore/sentryintegration.cpp
@@ -81,8 +81,13 @@ sentry_sink::sink_it_(const spdlog::details::log_msg& msg)
}
try
{
- std::string Message = fmt::format("{}\n{}({}) [{}]", msg.payload, msg.source.filename, msg.source.line, msg.source.funcname);
- sentry_value_t event = sentry_value_new_message_event(
+ auto MaybeNullString = [](const char* Ptr) { return Ptr ? Ptr : "<null>"; };
+ std::string Message = fmt::format("{}\n{}({}) [{}]",
+ msg.payload,
+ MaybeNullString(msg.source.filename),
+ msg.source.line,
+ MaybeNullString(msg.source.funcname));
+ sentry_value_t event = sentry_value_new_message_event(
/* level */ MapToSentryLevel[msg.level],
/* logger */ nullptr,
/* message */ Message.c_str());