mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-02-08 23:58:42 +01:00
catch exceptions thrown at some operations in general
This commit is contained in:
parent
b3be3860e8
commit
95211501ab
@ -115,7 +115,11 @@ class CalculatorImpl(calculator: Calculator, val context: Context) {
|
||||
|
||||
val operation = OperationFactory.forId(lastOperation!!, baseValue, secondValue)
|
||||
if (operation != null) {
|
||||
updateResult(operation.getResult())
|
||||
try {
|
||||
updateResult(operation.getResult())
|
||||
} catch (e: Exception) {
|
||||
context.toast(R.string.unknown_error_occurred)
|
||||
}
|
||||
}
|
||||
|
||||
isFirstOperation = false
|
||||
|
Loading…
x
Reference in New Issue
Block a user