diff --git a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java index bdd19a623..3a507c519 100644 --- a/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ChooseContactActivity.java @@ -21,6 +21,8 @@ import android.widget.AdapterView; import android.widget.ListView; import android.widget.TextView; +import com.google.common.base.Strings; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -347,7 +349,7 @@ public class ChooseContactActivity extends AbstractSearchableListItemActivity im private void handleActivityResult(ActivityResult activityResult) { if (activityResult.resultCode == RESULT_OK && activityResult.requestCode == ScanActivity.REQUEST_SCAN_QR_CODE) { String result = activityResult.data.getStringExtra(ScanActivity.INTENT_EXTRA_RESULT); - XmppUri uri = new XmppUri(result == null ? "" : result); + XmppUri uri = new XmppUri(Strings.nullToEmpty(result)); if (uri.isValidJid()) { showEnterJidDialog(uri); } diff --git a/src/main/java/eu/siacs/conversations/utils/XmppUri.java b/src/main/java/eu/siacs/conversations/utils/XmppUri.java index 5db19ad05..52f84f24b 100644 --- a/src/main/java/eu/siacs/conversations/utils/XmppUri.java +++ b/src/main/java/eu/siacs/conversations/utils/XmppUri.java @@ -174,11 +174,7 @@ public class XmppUri { jid = null; } } else { - try { - jid = Jid.ofEscaped(uri.toString()).asBareJid().toEscapedString(); - } catch (final IllegalArgumentException ignored) { - jid = null; - } + jid = null; } }