From 42d69fd5e3d32423e3c00fa7809d6331b14c4451 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 30 Dec 2019 00:23:44 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20crash=20when=20long=20pressing?= =?UTF-8?q?=20invalid=20geo-uris?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/eu/siacs/conversations/utils/GeoHelper.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/utils/GeoHelper.java b/src/main/java/eu/siacs/conversations/utils/GeoHelper.java index 79600075a..9847236ef 100644 --- a/src/main/java/eu/siacs/conversations/utils/GeoHelper.java +++ b/src/main/java/eu/siacs/conversations/utils/GeoHelper.java @@ -125,9 +125,13 @@ public class GeoHelper { } public static boolean openInOsmAnd(Context context, Message message) { - final GeoPoint geoPoint = parseGeoPoint(message.getBody()); - final String label = getLabel(context, message); - return geoIntent(geoPoint,label).resolveActivity(context.getPackageManager()) != null; + try { + final GeoPoint geoPoint = parseGeoPoint(message.getBody()); + final String label = getLabel(context, message); + return geoIntent(geoPoint, label).resolveActivity(context.getPackageManager()) != null; + } catch (IllegalArgumentException e) { + return false; + } } private static String getLabel(Context context, Message message) {