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.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp
index 8d087e8c6..58b76783a 100644
--- a/src/zencore/sentryintegration.cpp
+++ b/src/zencore/sentryintegration.cpp
@@ -60,11 +60,12 @@ public:
}
try
{
- std::string Message = fmt::format("{}\n{}({})", Msg.GetPayload(), Msg.GetSource().Filename, Msg.GetSource().Line);
- sentry_value_t Event = sentry_value_new_message_event(
- /* level */ MapToSentryLevel[Msg.GetLevel()],
- /* logger */ nullptr,
- /* message */ Message.c_str());
+ const char* Filename = Msg.GetSource().Filename ? Msg.GetSource().Filename : "<unknown>";
+ std::string Message = fmt::format("{}\n{}({})", Msg.GetPayload(), Filename, Msg.GetSource().Line);
+ sentry_value_t Event = sentry_value_new_message_event(
+ /* level */ MapToSentryLevel[Msg.GetLevel()],
+ /* logger */ nullptr,
+ /* message */ Message.c_str());
sentry_event_value_add_stacktrace(Event, NULL, 0);
sentry_capture_event(Event);
}