From 2165f062b2a71743e5bdbc9d1cc82706e3583cc4 Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 20 Mar 2020 07:57:45 +0100 Subject: [PATCH] prevent crash --- .../java/eu/faircode/email/NavMenuItem.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/NavMenuItem.java b/app/src/main/java/eu/faircode/email/NavMenuItem.java index 1aff170f32..17abd08150 100644 --- a/app/src/main/java/eu/faircode/email/NavMenuItem.java +++ b/app/src/main/java/eu/faircode/email/NavMenuItem.java @@ -87,12 +87,21 @@ public class NavMenuItem { } void onClick() { - click.run(); + try { + click.run(); + } catch (Throwable ex) { + Log.e(ex); + } } boolean onLongClick() { - if (longClick != null) - longClick.run(); - return (longClick != null); + try { + if (longClick != null) + longClick.run(); + return (longClick != null); + } catch (Throwable ex) { + Log.e(ex); + return false; + } } }