diff --git a/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift b/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift index de75fc46e..82f49370a 100644 --- a/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift +++ b/Mac/MainWindow/Timeline/Cell/MultilineTextFieldSizer.swift @@ -53,7 +53,10 @@ final class MultilineTextFieldSizer { } static func size(for attributedString: NSAttributedString, numberOfLines: Int, width: Int) -> TextFieldSizeInfo { - + guard attributedString.length > 0 else { + return TextFieldSizeInfo(size: NSSize.zero, numberOfLinesUsed: 0) + } + // Assumes the same font family/size for the whole string let font = attributedString.attribute(.font, at: 0, effectiveRange: nil) as! NSFont