Fixed crash when sublist is nil.
This commit is contained in:
@@ -260,15 +260,16 @@ public struct MTMathListBuilder {
|
|||||||
spacesAllowed = command == "text"
|
spacesAllowed = command == "text"
|
||||||
let oldFontStyle = currentFontStyle
|
let oldFontStyle = currentFontStyle
|
||||||
currentFontStyle = fontStyle
|
currentFontStyle = fontStyle
|
||||||
let sublist = self.buildInternal(true)!
|
if let sublist = self.buildInternal(true) {
|
||||||
// Restore the font style.
|
// Restore the font style.
|
||||||
currentFontStyle = oldFontStyle
|
currentFontStyle = oldFontStyle
|
||||||
spacesAllowed = oldSpacesAllowed
|
spacesAllowed = oldSpacesAllowed
|
||||||
|
|
||||||
prevAtom = sublist.atoms.last
|
prevAtom = sublist.atoms.last
|
||||||
list.append(sublist)
|
list.append(sublist)
|
||||||
if oneCharOnly {
|
if oneCharOnly {
|
||||||
return list
|
return list
|
||||||
|
}
|
||||||
}
|
}
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user