From ef607016275c40677c1c9419f9e04dea90ebc173 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 1935253c1814480fda11d4f6ace530a6b42f399f 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); }