Skip to content

Commit

Permalink
[emapp] adds null check of sokol's logging (#226)
Browse files Browse the repository at this point in the history
`spdlog` cannot pass NULL value to log format because `fmt`
library doesn't accept NULL value to `const char *` expected
and leads crash.
  • Loading branch information
hkrn authored Oct 2, 2022
1 parent cd692f9 commit 31b32ef
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion emapp/src/BaseApplicationService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5682,7 +5682,12 @@ BaseApplicationService::handleSGXMessage(void *opaque, const char *message, cons
sentry_value_set_by_key(breadcrumb, "category", sentry_value_new_string("error"));
sentry_add_breadcrumb(breadcrumb);
}
EMLOG_DEBUG("[{}:{}] {}", file, line, message);
if (file) {
EMLOG_DEBUG("Captured SGX error: file={} line={} message=\"{}\"", file, line, message);
}
else if (message) {
EMLOG_DEBUG("Captured SGX error: message=\"{}\"", message);
}
self->m_handledSGXMessages.insert(key);
}
SG_INSERT_MARKER(message);
Expand Down

0 comments on commit 31b32ef

Please sign in to comment.