fixed two rare npe
This commit is contained in:
parent
31657974bf
commit
5db04a37bd
|
@ -37,7 +37,10 @@ public class PresenceParser extends AbstractParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void parseContactPresence(PresencePacket packet, Account account) {
|
public void parseContactPresence(PresencePacket packet, Account account) {
|
||||||
String[] fromParts = packet.getAttribute("from").split("/");
|
if (packet.getFrom()==null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
String[] fromParts = packet.getFrom().split("/");
|
||||||
String type = packet.getAttribute("type");
|
String type = packet.getAttribute("type");
|
||||||
if (fromParts[0].equals(account.getJid())) {
|
if (fromParts[0].equals(account.getJid())) {
|
||||||
if (fromParts.length == 2) {
|
if (fromParts.length == 2) {
|
||||||
|
|
|
@ -305,6 +305,7 @@ public class ContactDetailsActivity extends XmppActivity {
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
super.onStop();
|
super.onStop();
|
||||||
boolean updated = false;
|
boolean updated = false;
|
||||||
|
if (contact!=null) {
|
||||||
boolean online = contact.getAccount().getStatus() == Account.STATUS_ONLINE;
|
boolean online = contact.getAccount().getStatus() == Account.STATUS_ONLINE;
|
||||||
if (contact.getOption(Contact.Options.FROM)) {
|
if (contact.getOption(Contact.Options.FROM)) {
|
||||||
if (!send.isChecked()) {
|
if (!send.isChecked()) {
|
||||||
|
@ -370,5 +371,6 @@ public class ContactDetailsActivity extends XmppActivity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue