aboutsummaryrefslogtreecommitdiff
path: root/events
diff options
context:
space:
mode:
Diffstat (limited to 'events')
-rw-r--r--events/receiptevent.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/events/receiptevent.cpp b/events/receiptevent.cpp
index 5267de4d..8029045a 100644
--- a/events/receiptevent.cpp
+++ b/events/receiptevent.cpp
@@ -70,6 +70,12 @@ ReceiptEvent* ReceiptEvent::fromJson(const QJsonObject& obj)
e->d->eventsToReceipts.reserve(contents.size());
for( auto eventIt = contents.begin(); eventIt != contents.end(); ++eventIt )
{
+ if (eventIt.key().isEmpty())
+ {
+ qWarning() << "ReceiptEvent has an empty event id, skipping";
+ qDebug() << "ReceiptEvent content follows:\n" << contents;
+ continue;
+ }
const QJsonObject reads = eventIt.value().toObject().value("m.read").toObject();
Receipts receipts; receipts.reserve(reads.size());
for( auto userIt = reads.begin(); userIt != reads.end(); ++userIt )