fixed crash on invalid muc bookmarks

This commit is contained in:
Daniel Gultsch 2015-07-15 17:42:08 +02:00
parent ffffca10f0
commit b525b42e59
1 changed files with 7 additions and 3 deletions

View File

@ -42,6 +42,7 @@ import android.widget.Checkable;
import android.widget.EditText; import android.widget.EditText;
import android.widget.ListView; import android.widget.ListView;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.Toast;
import com.google.zxing.integration.android.IntentIntegrator; import com.google.zxing.integration.android.IntentIntegrator;
import com.google.zxing.integration.android.IntentResult; import com.google.zxing.integration.android.IntentResult;
@ -263,9 +264,12 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
protected void openConversationForBookmark(int position) { protected void openConversationForBookmark(int position) {
Bookmark bookmark = (Bookmark) conferences.get(position); Bookmark bookmark = (Bookmark) conferences.get(position);
Conversation conversation = xmppConnectionService Jid jid = bookmark.getJid();
.findOrCreateConversation(bookmark.getAccount(), if (jid == null) {
bookmark.getJid(), true); Toast.makeText(this,R.string.invalid_jid,Toast.LENGTH_SHORT).show();
return;
}
Conversation conversation = xmppConnectionService.findOrCreateConversation(bookmark.getAccount(),jid, true);
conversation.setBookmark(bookmark); conversation.setBookmark(bookmark);
if (!conversation.getMucOptions().online()) { if (!conversation.getMucOptions().online()) {
xmppConnectionService.joinMuc(conversation); xmppConnectionService.joinMuc(conversation);