Fix crash when selection changes to nil in custom alert

Closes #517
This commit is contained in:
Shadowfacts 2024-07-24 20:31:37 -07:00
parent bcf2a2f026
commit 145ffbfcf0
1 changed files with 6 additions and 6 deletions

View File

@ -320,12 +320,12 @@ class CustomAlertActionsView: UIControl {
actionButtons[currentSelectedActionIndex].backgroundColor = nil actionButtons[currentSelectedActionIndex].backgroundColor = nil
} }
#if !os(visionOS) #if !os(visionOS)
if #available(iOS 17.5, *) { if selectedButton != nil {
let view = selectedButton!.element if #available(iOS 17.5, *) {
let location = convert(CGPoint(x: view.bounds.midX, y: view.bounds.midY), from: view) generator.selectionChanged(at: recognizer.location(in: generator.view))
generator.selectionChanged(at: location) } else {
} else { generator.selectionChanged()
generator.selectionChanged() }
} }
#endif #endif