Skip to content

Commit 0ea0f0a

Browse files
fix: Sentry.Serilog throws with a disabled DSN (#2883)
1 parent 24cfe5b commit 0ea0f0a

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-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
- Android native symbol upload ([#2876](https://github.com/getsentry/sentry-dotnet/pull/2876))
8+
- Sentry.Serilog no longer throws if a disabled DSN is provided when initializing Sentry via the Serilog integration ([#2883](https://github.com/getsentry/sentry-dotnet/pull/2883))
89

910
### .NET target frameworks changes
1011

src/Sentry.Serilog/SentrySinkExtensions.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// ReSharper disable once CheckNamespace - Discoverability
2+
23
namespace Serilog;
34

45
/// <summary>
@@ -189,7 +190,7 @@ public static void ConfigureSentrySerilogOptions(
189190
bool? initializeSdk = null,
190191
Dictionary<string, string>? defaultTags = null)
191192
{
192-
if (!string.IsNullOrWhiteSpace(dsn))
193+
if (dsn is not null)
193194
{
194195
sentrySerilogOptions.Dsn = dsn;
195196
}

0 commit comments

Comments
 (0)