aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorChristian Schneppe <christian.schneppe@pix-art.de>2020-01-02 11:52:14 +0100
committerChristian Schneppe <christian.schneppe@pix-art.de>2020-01-02 11:52:14 +0100
commit8cbc7b2a07ba546aa75601a0b5410f01bc37de66 (patch)
treec4444edc7de9cb99445c7df989f74c50cae4d601 /src/main/java/de
parentdd5f790b21c7c90e1696bed243893eb31c0e1aeb (diff)
don’t crash when long pressing invalid geo-uris
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/utils/GeoHelper.java10
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) {