From 0da9f64edabd21848196d3699ed6289bfa4d5d0c Mon Sep 17 00:00:00 2001 From: zhanglecong Date: Sat, 14 Sep 2024 00:40:48 +0800 Subject: [PATCH] Remove useless nil guard --- Sources/SwiftMath/MathRender/MTMathImage.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/SwiftMath/MathRender/MTMathImage.swift b/Sources/SwiftMath/MathRender/MTMathImage.swift index 20d62c4..9f6bc2c 100644 --- a/Sources/SwiftMath/MathRender/MTMathImage.swift +++ b/Sources/SwiftMath/MathRender/MTMathImage.swift @@ -73,9 +73,7 @@ extension MTMathImage { let textY = (availableHeight - height) / 2 + displayList.descent + contentInsets.bottom displayList.position = CGPoint(x: textX, y: textY) } - if font == nil { - self.font = MTFontManager.fontManager.defaultFont - } + var error: NSError? guard let mathList = MTMathListBuilder.build(fromString: latex, error: &error), error == nil, let displayList = MTTypesetter.createLineForMathList(mathList, font: font, style: currentStyle) else {