adding a widget crashfix

This commit is contained in:
tibbi
2022-01-31 23:03:23 +01:00
parent 3c596bcd7c
commit 423f3e11ff
2 changed files with 3 additions and 2 deletions

View File

@ -62,7 +62,7 @@ android {
} }
dependencies { dependencies {
implementation 'com.github.SimpleMobileTools:Simple-Commons:9cb42cbf35' implementation 'com.github.SimpleMobileTools:Simple-Commons:fe2610738c'
implementation 'me.grantland:autofittextview:0.2.1' implementation 'me.grantland:autofittextview:0.2.1'
implementation 'net.objecthunter:exp4j:0.4.8' implementation 'net.objecthunter:exp4j:0.4.8'

View File

@ -288,7 +288,8 @@ class CalculatorImpl(calculator: Calculator, private val context: Context) {
} }
fun handleClear() { fun handleClear() {
val lastDeletedValue = inputDisplayedFormula.last().toString() val lastDeletedValue = inputDisplayedFormula.lastOrNull().toString()
var newValue = inputDisplayedFormula.dropLast(1) var newValue = inputDisplayedFormula.dropLast(1)
if (newValue == "") { if (newValue == "") {
newValue = "0" newValue = "0"