Don’t crash when cellAppearance is nil.
This commit is contained in:
parent
b0b7441687
commit
c19dba6998
@ -37,7 +37,7 @@ class SidebarCell : NSTableCellView {
|
|||||||
|
|
||||||
private let unreadCountView = UnreadCountView(frame: NSZeroRect)
|
private let unreadCountView = UnreadCountView(frame: NSZeroRect)
|
||||||
|
|
||||||
var cellAppearance: SidebarCellAppearance! {
|
var cellAppearance: SidebarCellAppearance? {
|
||||||
didSet {
|
didSet {
|
||||||
if cellAppearance != oldValue {
|
if cellAppearance != oldValue {
|
||||||
needsLayout = true
|
needsLayout = true
|
||||||
@ -105,7 +105,7 @@ class SidebarCell : NSTableCellView {
|
|||||||
|
|
||||||
override func resizeSubviews(withOldSize oldSize: NSSize) {
|
override func resizeSubviews(withOldSize oldSize: NSSize) {
|
||||||
|
|
||||||
guard let textField = textField else {
|
guard let textField = textField, let cellAppearance = cellAppearance else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let layout = SidebarCellLayout(appearance: cellAppearance, cellSize: bounds.size, shouldShowImage: shouldShowImage, textField: textField, unreadCountView: unreadCountView)
|
let layout = SidebarCellLayout(appearance: cellAppearance, cellSize: bounds.size, shouldShowImage: shouldShowImage, textField: textField, unreadCountView: unreadCountView)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user