From 261207a4c01dc865358de125702315404cee5c01 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Mon, 7 Dec 2020 09:03:01 +0100 Subject: [PATCH] ignore whitespace when trying to detect provisioning json fixes #3940 --- .../java/eu/siacs/conversations/ui/UriHandlerActivity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java b/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java index fdebd6a56..30c330c4d 100644 --- a/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/UriHandlerActivity.java @@ -246,6 +246,7 @@ public class UriHandlerActivity extends AppCompatActivity { } private static boolean looksLikeJsonObject(final String input) { - return input.charAt(0) == '{' && input.charAt(input.length() - 1) == '}'; + final String trimmed = Strings.emptyToNull(input).trim(); + return trimmed.charAt(0) == '{' && trimmed.charAt(trimmed.length() - 1) == '}'; } } \ No newline at end of file