diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-02 11:52:14 +0100 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2020-01-02 11:52:14 +0100 |
commit | 8cbc7b2a07ba546aa75601a0b5410f01bc37de66 (patch) | |
tree | c4444edc7de9cb99445c7df989f74c50cae4d601 /src/main/java/de | |
parent | dd5f790b21c7c90e1696bed243893eb31c0e1aeb (diff) |
don’t crash when long pressing invalid geo-uris
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/utils/GeoHelper.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/utils/GeoHelper.java b/src/main/java/de/pixart/messenger/utils/GeoHelper.java index 75605ac7f..966d034d3 100644 --- a/src/main/java/de/pixart/messenger/utils/GeoHelper.java +++ b/src/main/java/de/pixart/messenger/utils/GeoHelper.java @@ -114,9 +114,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) { |