Skip to content

Commit 8bff94d

Browse files
authored
fix: Fix crashing when SDK is disabled via options (#253)
* Fix null pointer dereference in SentrySDK::get_user * Update CHANGELOG.md
1 parent f0d4cb4 commit 8bff94d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixes
66

77
- Check options.enabled during SDK initialization ([#250](https://github.com/getsentry/sentry-godot/pull/250))
8+
- Fix crashing when SDK is disabled via options ([#253](https://github.com/getsentry/sentry-godot/pull/253))
89

910
## 1.0.0-alpha.0
1011

src/sentry_sdk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ void SentrySDK::set_user(const Ref<SentryUser> &p_user) {
139139

140140
Ref<SentryUser> SentrySDK::get_user() const {
141141
MutexLock lock(*user_mutex.ptr());
142-
return user->duplicate();
142+
return user.is_valid() ? user->duplicate() : nullptr;
143143
}
144144

145145
void SentrySDK::remove_user() {

0 commit comments

Comments
 (0)