Remove force-unwrapping which may be trigger a crashing bug.

This commit is contained in:
Brent Simmons
2025-04-27 21:25:03 -07:00
parent eb10ccaea0
commit 2e019492f7
2 changed files with 13 additions and 13 deletions

View File

@@ -10,9 +10,9 @@ import UIKit
class MainTimelineTitleView: UIView {
@IBOutlet weak var iconView: IconView!
@IBOutlet weak var label: UILabel!
@IBOutlet weak var unreadCountView: MainTimelineUnreadCountView!
@IBOutlet var iconView: IconView?
@IBOutlet var label: UILabel?
@IBOutlet var unreadCountView: MainTimelineUnreadCountView?
@available(iOS 13.4, *)
private lazy var pointerInteraction: UIPointerInteraction = {
@@ -22,9 +22,9 @@ class MainTimelineTitleView: UIView {
override var accessibilityLabel: String? {
set { }
get {
if let name = label.text {
if let name = label?.text {
let unreadLabel = NSLocalizedString("unread", comment: "Unread label for accessiblity")
return "\(name) \(unreadCountView.unreadCount) \(unreadLabel)"
return "\(name) \(unreadCountView?.unreadCount ?? 0) \(unreadLabel)"
}
else {
return nil