diff --git a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt index d8aadc0..70c9b8f 100644 --- a/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt +++ b/app/src/main/kotlin/com/simplemobiletools/calculator/helpers/CalculatorImpl.kt @@ -168,6 +168,10 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) { if (lastKey != EQUALS) { val valueToCheck = inputDisplayedFormula.trimStart('-').replace(",", "") val parts = valueToCheck.split(operationsRegex).filter { it != "" } + if (parts.isEmpty()) { + return + } + baseValue = Formatter.stringToDouble(parts.first()) if (inputDisplayedFormula.startsWith("-")) { baseValue *= -1