File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 55### Fixes
66
77- Remove unnecesary dependency on `SentryCppHelper` to Sentry (#6754) (#6761)
8+ - Resolve SDK crash caused by UIPrintPanelViewController incorrectly casting to UISplitViewController (#6771)
89
910## 8.57.2
1011
Original file line number Diff line number Diff line change @@ -136,8 +136,18 @@ extension SentryApplication {
136136 return nil
137137 }
138138 }
139+
139140 if let splitViewController = vc as? UISplitViewController {
140- if splitViewController. viewControllers. count > 0 {
141+ // We encountered a case where the private class `UIPrintPanelViewController` overrides the `isKindOfClass:` method and wrongfully
142+ // allows casting to `UISplitViewController`, while not actually being a subclass:
143+ //
144+ // -[UIPrintPanelViewController viewControllers]: unrecognized selector sent to instance 0x124f45e00
145+ //
146+ // Check if the selector exists as a double-check mechanism
147+ // See: https://github.com/getsentry/sentry-cocoa/issues/6725
148+ if !splitViewController. responds ( to: NSSelectorFromString ( " viewControllers " ) ) {
149+ SentrySDKLog . warning ( " Failed to get viewControllers from UISplitViewController. This is a known bug in iOS 26.1 " )
150+ } else if splitViewController. viewControllers. count > 0 {
141151 return splitViewController. viewControllers
142152 }
143153 }
You can’t perform that action at this time.
0 commit comments