diff --git a/Sources/SwiftMath/MathRender/MTMathListBuilder.swift b/Sources/SwiftMath/MathRender/MTMathListBuilder.swift index 69a117d..ac3216b 100644 --- a/Sources/SwiftMath/MathRender/MTMathListBuilder.swift +++ b/Sources/SwiftMath/MathRender/MTMathListBuilder.swift @@ -226,11 +226,12 @@ public struct MTMathListBuilder { continue } else if char == "{" { // this puts us in a recursive routine, and sets oneCharOnly to false and no stop character - let subList = self.buildInternal(false, stopChar: "}") - prevAtom = subList!.atoms.last - list.append(subList) - if oneCharOnly { - return list + if let subList = self.buildInternal(false, stopChar: "}") { + prevAtom = subList.atoms.last + list.append(subList) + if oneCharOnly { + return list + } } continue } else if char == "}" {