Skip to content

Commit 57e4b4f

Browse files
committed
Additional force unwrap fixes
1 parent 4bc8815 commit 57e4b4f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Spring/DesignableLabel.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ import UIKit
2727
@IBInspectable public var lineHeight: CGFloat = 1.5 {
2828
didSet {
2929
let font = UIFont(name: self.font.fontName, size: self.font.pointSize)
30-
let text = self.text
30+
guard let text = self.text else { return }
3131

3232
let paragraphStyle = NSMutableParagraphStyle()
3333
paragraphStyle.lineSpacing = lineHeight
3434

35-
let attributedString = NSMutableAttributedString(string: text!)
35+
let attributedString = NSMutableAttributedString(string: text)
3636
attributedString.addAttribute(NSAttributedStringKey.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, attributedString.length))
3737
attributedString.addAttribute(NSAttributedStringKey.font, value: font!, range: NSMakeRange(0, attributedString.length))
3838

0 commit comments

Comments
 (0)