mirror of
https://github.com/moparisthebest/Conversations
synced 2024-11-30 20:52:21 -05:00
fixed potential NPEs
This commit is contained in:
parent
a142dcc263
commit
a207240881
@ -344,8 +344,13 @@ public class MessageParser extends AbstractParser implements
|
|||||||
|
|
||||||
private void parseEvent(final Element event, final Jid from, final Account account) {
|
private void parseEvent(final Element event, final Jid from, final Account account) {
|
||||||
Element items = event.findChild("items");
|
Element items = event.findChild("items");
|
||||||
|
if (items == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
String node = items.getAttribute("node");
|
String node = items.getAttribute("node");
|
||||||
if (node != null) {
|
if (node == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (node.equals("urn:xmpp:avatar:metadata")) {
|
if (node.equals("urn:xmpp:avatar:metadata")) {
|
||||||
Avatar avatar = Avatar.parseMetadata(items);
|
Avatar avatar = Avatar.parseMetadata(items);
|
||||||
if (avatar != null) {
|
if (avatar != null) {
|
||||||
@ -392,7 +397,6 @@ public class MessageParser extends AbstractParser implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private String getPgpBody(Element message) {
|
private String getPgpBody(Element message) {
|
||||||
Element child = message.findChild("x", "jabber:x:encrypted");
|
Element child = message.findChild("x", "jabber:x:encrypted");
|
||||||
|
Loading…
Reference in New Issue
Block a user