Fixes a small issue introduced in commit 1691b11370 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.

main
Vavassor 8 years ago
parent adfb96483a
commit 805fbe2690
  1. 2
      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 // If we share with an app, it's not only an url
List<String> strings = StringUtils.extractUrl(pasteData); List<String> strings = StringUtils.extractUrl(pasteData);
String url = strings.get(0); // we assume that the first url is the good one
if (strings.size() > 0) { if (strings.size() > 0) {
String url = strings.get(0); // we assume that the first url is the good one
if (URLUtil.isValidUrl(url)) { if (URLUtil.isValidUrl(url)) {
new ThreadHeaderInfo().execute(url); new ThreadHeaderInfo().execute(url);
} }

Loading…
Cancel
Save