Skip to content

Commit

Permalink
Fix crash
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanPodymov committed Apr 30, 2024
1 parent 48f28f4 commit b0fbabf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Sources/CommonAppleKit/CommonAppleKit.swift
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,11 @@
}

var selectedViewController: CAViewController? {
get {
viewControllers?[selectedTabViewItemIndex]
guard selectedTabViewItemIndex >= 0 else {
return nil
}
return viewControllers.flatMap {
selectedTabViewItemIndex < $0.count ? $0[selectedTabViewItemIndex] : nil
}
}
}
Expand Down

0 comments on commit b0fbabf

Please sign in to comment.