Skip to content

Commit

Permalink
Fix: Check if clipPath is empty before removing last element (#4649)
Browse files Browse the repository at this point in the history
* Check if clipPath is empty before removing last element

* Updates changelog
  • Loading branch information
antonis authored Dec 19, 2024
1 parent 0b53d9c commit e304199
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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)

### 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

0 comments on commit e304199

Please sign in to comment.