Skip to content

Commit

Permalink
check null dsn
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaMoelans committed Feb 5, 2025
1 parent 46ad5b0 commit a2508cd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/backends/sentry_backend_crashpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,8 +439,9 @@ crashpad_backend_startup(
if (minidump_url) {
SENTRY_DEBUGF("using minidump URL \"%s\"", minidump_url);
}
const char *env_proxy
= getenv(options->dsn->is_secure ? "https_proxy" : "http_proxy");
const char *env_proxy = options->dsn
? getenv(options->dsn->is_secure ? "https_proxy" : "http_proxy")
: nullptr;
const char *proxy_url = options->proxy ? options->proxy
: env_proxy ? env_proxy
: "";
Expand Down
5 changes: 3 additions & 2 deletions src/transports/sentry_transport_winhttp.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ sentry__winhttp_transport_start(
state->user_agent = sentry__string_to_wstr(opts->user_agent);
state->debug = opts->debug;

const char *env_proxy
= getenv(opts->dsn->is_secure ? "https_proxy" : "http_proxy");
const char *env_proxy = opts->dsn
? getenv(opts->dsn->is_secure ? "https_proxy" : "http_proxy")
: NULL;
const char *proxy = opts->proxy ? opts->proxy : env_proxy ? env_proxy : "";

// ensure the proxy starts with `http://`, otherwise ignore it
Expand Down

0 comments on commit a2508cd

Please sign in to comment.