Fix crash when sqrt has no radicand

This commit is contained in:
André Douzette
2023-07-06 11:33:12 +02:00
parent 695c8a6b84
commit a482791f57
2 changed files with 41 additions and 0 deletions

View File

@@ -537,6 +537,10 @@ public struct MTMathListBuilder {
} else if command == "sqrt" {
// A sqrt command with one argument
let rad = MTRadical()
guard self.hasCharacters else {
rad.radicand = self.buildInternal(true)
return rad
}
let ch = self.getNextCharacter()
if (ch == "[") {
// special handling for sqrt[degree]{radicand}