Skip to content
Snippets Groups Projects
Unverified Commit bcc0c32a authored by Daniel Gultsch's avatar Daniel Gultsch
Browse files

fix crash when using direct jingle init on offline contacts

parent 1090b2ed
Branches
Tags
No related merge requests found
......@@ -32,6 +32,7 @@ package eu.siacs.conversations.ui.util;
import android.app.Activity;
import android.content.Context;
import android.util.Pair;
import android.widget.Toast;
import androidx.appcompat.app.AlertDialog;
......@@ -60,7 +61,9 @@ public class PresenceSelector {
public static void selectFullJidForDirectRtpConnection(final Activity activity, final Contact contact, final RtpCapability.Capability required, final OnFullJidSelected onFullJidSelected) {
final String[] resources = RtpCapability.filterPresences(contact, required);
if (resources.length == 1) {
if (resources.length == 0) {
Toast.makeText(activity,R.string.rtp_state_contact_offline,Toast.LENGTH_LONG).show();
} else if (resources.length == 1) {
onFullJidSelected.onFullJidSelected(contact.getJid().withResource(resources[0]));
} else {
showPresenceSelectionDialog(activity, contact, resources, onFullJidSelected);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment