Skip to content

Commit

Permalink
Fix event's message get/set methods for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
tustanivsky committed Mar 5, 2024
1 parent d3a7dbd commit d3c23ac
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ sentry_value_t SentryEventDesktop::GetNativeObject()

void SentryEventDesktop::SetMessage(const FString& message)
{
sentry_value_set_by_key(EventDesktop, "message", sentry_value_new_string(TCHAR_TO_ANSI(*message)));
sentry_value_t messageСontainer = sentry_value_new_object();
sentry_value_set_by_key(messageСontainer, "formatted", sentry_value_new_string(TCHAR_TO_ANSI(*message)));
sentry_value_set_by_key(EventDesktop, "message", messageСontainer);
}

FString SentryEventDesktop::GetMessage() const
{
sentry_value_t message = sentry_value_get_by_key(EventDesktop, "message");
sentry_value_t messageСontainer = sentry_value_get_by_key(EventDesktop, "message");
sentry_value_t message = sentry_value_get_by_key(messageСontainer, "formatted");
return FString(sentry_value_as_string(message));
}

Expand Down

0 comments on commit d3c23ac

Please sign in to comment.