You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,7 @@
8
8
- Target `net9.0` on Sentry.Google.Cloud.Functions to avoid conflict with Sentry.AspNetCore ([#4039](https://github.com/getsentry/sentry-dotnet/pull/4039))
9
9
- Changed default value for `SentryOptions.EnableAppHangTrackingV2` to `false` ([#4042](https://github.com/getsentry/sentry-dotnet/pull/4042))
10
10
- Missing MAUI `Shell` navigation breadcrumbs on iOS ([#4006](https://github.com/getsentry/sentry-dotnet/pull/4006))
11
+
- Prevent application crashes when capturing screenshots on iOS ([#4069](https://github.com/getsentry/sentry-dotnet/pull/4069))
Copy file name to clipboardExpand all lines: src/Sentry.Maui/Internal/ScreenshotAttachment.cs
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,22 @@ public ScreenshotAttachmentContent(SentryMauiOptions options)
39
39
}
40
40
41
41
publicStreamGetStream()
42
+
{
43
+
try
44
+
{
45
+
returnGetStreamInternal();
46
+
}
47
+
catch(Exceptionex)
48
+
{
49
+
// See https://github.com/getsentry/sentry-dotnet/issues/3880#issuecomment-2640159466
50
+
_options.LogError("Failed to capture screenshot",ex);
51
+
// Return empty stream since calling code may assume a non-null return value
52
+
// E.g. https://github.com/getsentry/sentry-dotnet/blob/db5606833a4b0662c6bea0663cca10cb05fb5157/src/Sentry/Protocol/Envelopes/EnvelopeItem.cs#L332-L333
53
+
returnnewMemoryStream();
54
+
}
55
+
}
56
+
57
+
privateStreamGetStreamInternal()
42
58
{
43
59
varstream=Stream.Null;
44
60
// Not including this on Windows specific build because on WinUI this can deadlock.
0 commit comments