In case of invalid XML in the payloads, at least still load the message

This commit is contained in:
Stephen Paul Weber 2024-05-20 18:50:56 +02:00 committed by Arne
parent 9b2d51b527
commit 5f15e851fa

View file

@ -309,8 +309,12 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
final XmlReader xmlReader = new XmlReader();
xmlReader.setInputStream(ByteSource.wrap(payloadsStr.getBytes()).openStream());
Tag tag;
while ((tag = xmlReader.readTag()) != null) {
payloads.add(xmlReader.readElement(tag));
try {
while ((tag = xmlReader.readTag()) != null) {
payloads.add(xmlReader.readElement(tag));
}
} catch (IOException e) {
Log.e(Config.LOGTAG, "Failed to parse: " + payloadsStr, e);
}
}