From fdee75c84a611b7151be3f266144fe5edacbf620 Mon Sep 17 00:00:00 2001 From: Konrad Pozniak Date: Tue, 2 Jul 2019 10:55:02 +0200 Subject: [PATCH] fix crash caused by broken mention (#1360) --- .../main/java/com/keylesspalace/tusky/util/LinkHelper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/util/LinkHelper.java b/app/src/main/java/com/keylesspalace/tusky/util/LinkHelper.java index 929c0ac46..8fe257bef 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/LinkHelper.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/LinkHelper.java @@ -48,7 +48,9 @@ public class LinkHelper { return ""; } String host = uri.getHost(); - if (host.startsWith("www.")) { + if(host == null) { + return ""; + } else if (host.startsWith("www.")) { return host.substring(4); } else { return host;