From 636800178c0a46b90ba26e6d3689a7aeb0b72cfc Mon Sep 17 00:00:00 2001 From: serso Date: Mon, 14 Mar 2016 21:40:49 +0100 Subject: [PATCH] Don't crash with runtime exception --- .../main/java/org/solovyev/android/calculator/Calculator.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/org/solovyev/android/calculator/Calculator.java b/app/src/main/java/org/solovyev/android/calculator/Calculator.java index 04002db7..6fbcc090 100644 --- a/app/src/main/java/org/solovyev/android/calculator/Calculator.java +++ b/app/src/main/java/org/solovyev/android/calculator/Calculator.java @@ -197,6 +197,8 @@ public class Calculator implements SharedPreferences.OnSharedPreferenceChangeLis bus.post(new CalculationCancelledEvent(o, e, sequence)); } catch (ParseException exception) { onException(sequence, o, e, mr, pe, exception); + } catch (RuntimeException exception) { + onException(sequence, o, e, mr, pe, new ParseException(e, new CalculatorMessage(CalculatorMessages.syntax_error, MessageType.error))); } }