Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Check if clipPath is empty before removing last element #4649

Merged
merged 2 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

- `SentrySdkInfo.packages` should be an array (#4626)
- Use the same SdkInfo for envelope header and event (#4629)
- Fixes Session replay screenshot provider crash (#4649)
brustolin marked this conversation as resolved.
Show resolved Hide resolved

### Internal

Expand Down
4 changes: 3 additions & 1 deletion Sources/Swift/Tools/SentryViewPhotographer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ class SentryViewPhotographer: NSObject, SentryViewScreenshotProvider {
clipPaths: clipPaths,
clipOutPath: clipOutPath)
case .clipEnd:
clipPaths.removeLast()
if !clipPaths.isEmpty {
clipPaths.removeLast()
}
self.updateClipping(for: context.cgContext,
clipPaths: clipPaths,
clipOutPath: clipOutPath)
Expand Down
Loading