fixed two rare npe

This commit is contained in:
iNPUTmice 2014-06-25 17:32:58 +02:00
parent 31657974bf
commit 5db04a37bd
2 changed files with 49 additions and 44 deletions

View file

@ -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) {

View file

@ -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 {
} }
} }
} }
}
} }