Skip to content

Commit e304199

Browse files
authored
Fix: Check if clipPath is empty before removing last element (#4649)
* Check if clipPath is empty before removing last element * Updates changelog
1 parent 0b53d9c commit e304199

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
- `SentrySdkInfo.packages` should be an array (#4626)
1616
- Use the same SdkInfo for envelope header and event (#4629)
17+
- Fixes Session replay screenshot provider crash (#4649)
1718

1819
### Internal
1920

Sources/Swift/Tools/SentryViewPhotographer.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ class SentryViewPhotographer: NSObject, SentryViewScreenshotProvider {
8282
clipPaths: clipPaths,
8383
clipOutPath: clipOutPath)
8484
case .clipEnd:
85-
clipPaths.removeLast()
85+
if !clipPaths.isEmpty {
86+
clipPaths.removeLast()
87+
}
8688
self.updateClipping(for: context.cgContext,
8789
clipPaths: clipPaths,
8890
clipOutPath: clipOutPath)

0 commit comments

Comments
 (0)