mirror of
https://github.com/SimpleMobileTools/Simple-Calculator.git
synced 2025-06-05 21:49:13 +02:00
catch exceptions thrown at some operations in general
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user