Fix a crash if a message subnode is not found in a carbon

Fixes #1392
This commit is contained in:
Bohdan Horbeshko 2023-03-18 17:23:46 +02:00 committed by Marvin W
parent 444275a99d
commit adb2b58b61

View file

@ -58,6 +58,10 @@ public class ReceivedPipelineListener : StanzaListener<MessageStanza> {
warning("Received alleged carbon message from %s, ignoring", message.from.to_string()); warning("Received alleged carbon message from %s, ignoring", message.from.to_string());
return true; return true;
} }
if (message_node == null) {
warning("Received a carbon message with no message subnode in jabber:client namespace from %s, ignoring", message.from.to_string());
return true;
}
if (received_node != null) { if (received_node != null) {
message.add_flag(new MessageFlag(MessageFlag.TYPE_RECEIVED)); message.add_flag(new MessageFlag(MessageFlag.TYPE_RECEIVED));
} else if (sent_node != null) { } else if (sent_node != null) {