fix very rare NPE (race condition)
This commit is contained in:
parent
8f76084a43
commit
3fac7d4992
|
@ -102,14 +102,21 @@ public class PublishProfilePictureActivity extends XmppActivity implements XmppC
|
||||||
xmppConnectionService.publishAvatar(account, avatarUri, this);
|
xmppConnectionService.publishAvatar(account, avatarUri, this);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.cancelButton.setOnClickListener(v -> {
|
this.cancelButton.setOnClickListener(
|
||||||
|
v -> {
|
||||||
if (mInitialAccountSetup) {
|
if (mInitialAccountSetup) {
|
||||||
final Intent intent = new Intent(getApplicationContext(), StartConversationActivity.class);
|
final Intent intent =
|
||||||
if (xmppConnectionService != null && xmppConnectionService.getAccounts().size() == 1) {
|
new Intent(
|
||||||
|
getApplicationContext(), StartConversationActivity.class);
|
||||||
|
if (xmppConnectionService != null
|
||||||
|
&& xmppConnectionService.getAccounts().size() == 1) {
|
||||||
intent.putExtra("init", true);
|
intent.putExtra("init", true);
|
||||||
}
|
}
|
||||||
StartConversationActivity.addInviteUri(intent, getIntent());
|
StartConversationActivity.addInviteUri(intent, getIntent());
|
||||||
intent.putExtra(EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString());
|
if (account != null) {
|
||||||
|
intent.putExtra(
|
||||||
|
EXTRA_ACCOUNT, account.getJid().asBareJid().toEscapedString());
|
||||||
|
}
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
}
|
}
|
||||||
finish();
|
finish();
|
||||||
|
|
|
@ -1080,7 +1080,7 @@ public class XmppConnection implements Runnable {
|
||||||
tagWriter.writeElement(authenticate);
|
tagWriter.writeElement(authenticate);
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<String> extractMechanisms(final Element stream) {
|
private static List<String> extractMechanisms(final Element stream) {
|
||||||
final ArrayList<String> mechanisms = new ArrayList<>(stream
|
final ArrayList<String> mechanisms = new ArrayList<>(stream
|
||||||
.getChildren().size());
|
.getChildren().size());
|
||||||
for (final Element child : stream.getChildren()) {
|
for (final Element child : stream.getChildren()) {
|
||||||
|
|
Loading…
Reference in a new issue