This commit is contained in:
Stephen Paul Weber 2022-04-06 08:29:39 -05:00
parent 116dde9c65
commit 617ceb2429
No known key found for this signature in database
GPG Key ID: D11C2911CE519CDE
1 changed files with 2 additions and 1 deletions

View File

@ -159,10 +159,11 @@ public class EnterJidDialog extends DialogFragment implements OnBackendConnected
@Override
public void onItemSelected(AdapterView accountSpinner, View view, int position, long id) {
XmppActivity context = (XmppActivity) getActivity();
if (context.xmppConnectionService == null || accountJid() == null) return;
if (context == null || context.xmppConnectionService == null || accountJid() == null) return;
gatewayListAdapter.clear();
final Account account = context.xmppConnectionService.findAccountByJid(accountJid());
if (account == null) return;
for (final Contact contact : account.getRoster().getContacts()) {
if (contact.showInRoster() && (contact.getPresences().anyIdentity("gateway", null) || contact.getPresences().anySupport("jabber:iq:gateway"))) {