mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-04-13 01:32:07 +02:00
adding a list empty check
This commit is contained in:
parent
2b8fe04820
commit
def1240f0f
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user