Fixed crash on invalid syntax in curly braces.

This commit is contained in:
Michael Griebling
2023-02-27 08:11:26 -05:00
parent c1745cc773
commit 8d50c79c91

View File

@@ -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 == "}" {