Skip to content

Commit a3189e5

Browse files
authored
chore: Merge changes of v8.57.3 back into main (#6774)
1 parent 3bd9891 commit a3189e5

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,13 @@
146146
- Move `enableDataSwizzling` from experimental options to top-level options (#6592). This option remains enabled by default.
147147
- Add `sentry.replay_id` attribute to logs ([#6515](https://github.com/getsentry/sentry-cocoa/pull/6515))
148148

149+
## 8.57.3
150+
151+
### Fixes
152+
153+
- Remove unnecesary dependency on `SentryCppHelper` to Sentry (#6754) (#6761)
154+
- Resolve SDK crash caused by UIPrintPanelViewController incorrectly casting to UISplitViewController (#6771)
155+
149156
## 8.57.2
150157

151158
### Fixes

Sources/Swift/Helper/SentryApplicationExtensions.swift

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,18 @@ extension SentryApplication {
134134
return nil
135135
}
136136
}
137+
137138
if let splitViewController = vc as? UISplitViewController {
138-
if splitViewController.viewControllers.count > 0 {
139+
// We encountered a case where the private class `UIPrintPanelViewController` overrides the `isKindOfClass:` method and wrongfully
140+
// allows casting to `UISplitViewController`, while not actually being a subclass:
141+
//
142+
// -[UIPrintPanelViewController viewControllers]: unrecognized selector sent to instance 0x124f45e00
143+
//
144+
// Check if the selector exists as a double-check mechanism
145+
// See: https://github.com/getsentry/sentry-cocoa/issues/6725
146+
if !splitViewController.responds(to: NSSelectorFromString("viewControllers")) {
147+
SentrySDKLog.warning("Failed to get viewControllers from UISplitViewController. This is a known bug in iOS 26.1")
148+
} else if splitViewController.viewControllers.count > 0 {
139149
return splitViewController.viewControllers
140150
}
141151
}

0 commit comments

Comments
 (0)