Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions samples/Sentry.Samples.Ios/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public override bool FinishedLaunching(UIApplication application, NSDictionary l
options.CacheDirectoryPath = Path.GetTempPath();
});

SentrySdk.ConfigureScope(scope =>
{
scope.SetTag("IAmNull", null!);
});

// create a new window instance based on the screen size
Window = new UIWindow(UIScreen.MainScreen.Bounds);

Expand Down
6 changes: 6 additions & 0 deletions src/Sentry/Platforms/Cocoa/CocoaScopeObserver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ public void SetExtra(string key, object? value)

public void SetTag(string key, string value)
{
if (value is null)
{
_options.LogDebug("Tag with key '{0}' was null.", key);
return;
}

try
{
SentryCocoaSdk.ConfigureScope(scope => scope.SetTagValue(value, key));
Expand Down
Loading