From 805fbe2690aae63ffbfb66e02e72efe302ebca3a Mon Sep 17 00:00:00 2001 From: Vavassor Date: Fri, 23 Jun 2017 01:22:18 -0400 Subject: [PATCH] Fixes a small issue introduced in commit 1691b11370cbe6f269177a3c9566b4bcd7c3c7f8 where pasting in the composer crashes when it doesn't contain a URL (so any other textual paste will crash). The code was intended only for "share" actions, hence why it was expecting a URL enclosed. --- app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java b/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java index 90a155b1..aa54059b 100644 --- a/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java +++ b/app/src/main/java/com/keylesspalace/tusky/util/ParserUtils.java @@ -40,8 +40,8 @@ public class ParserUtils { // If we share with an app, it's not only an url List strings = StringUtils.extractUrl(pasteData); - String url = strings.get(0); // we assume that the first url is the good one if (strings.size() > 0) { + String url = strings.get(0); // we assume that the first url is the good one if (URLUtil.isValidUrl(url)) { new ThreadHeaderInfo().execute(url); }