Skip to content

Commit dd71fb7

Browse files
authored
fix: Check options.enabled during SDK initialization (#250)
1 parent ed6e254 commit dd71fb7

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
### Fixes
6+
7+
- Check options.enabled during SDK initialization ([#250](https://github.com/getsentry/sentry-godot/pull/250))
8+
39
## 1.0.0-alpha.0
410

511
### Breaking changes

src/sentry_sdk.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ PackedStringArray SentrySDK::_get_global_attachments() {
204204
void SentrySDK::_initialize() {
205205
sentry::util::print_debug("starting Sentry SDK version " + String(SENTRY_GODOT_SDK_VERSION));
206206

207+
if (!SentryOptions::get_singleton()->is_enabled()) {
208+
enabled = false;
209+
sentry::util::print_debug("Sentry SDK is DISABLED! Operations with Sentry SDK will result in no-ops.");
210+
return;
211+
}
212+
207213
#ifdef NATIVE_SDK
208214
internal_sdk = std::make_shared<NativeSDK>();
209215
enabled = true;

0 commit comments

Comments
 (0)