From 86acf9fb5a5ea4328e6130ba8263ec8cd82ba0d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Pla=CC=81s=CC=8Cil?= Date: Tue, 18 Jul 2017 10:03:35 +0800 Subject: Room event timestamp can also be undefined --- events/event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/events/event.cpp b/events/event.cpp index 0132fdc6..8a6de822 100644 --- a/events/event.cpp +++ b/events/event.cpp @@ -50,14 +50,14 @@ QByteArray Event::originalJson() const QDateTime Event::toTimestamp(const QJsonValue& v) { - Q_ASSERT(v.isDouble() || v.isNull()); + Q_ASSERT(v.isDouble() || v.isNull() || v.isUndefined()); return QDateTime::fromMSecsSinceEpoch( static_cast(v.toDouble()), Qt::UTC); } QStringList Event::toStringList(const QJsonValue& v) { - Q_ASSERT(v.isArray() || v.isNull()); + Q_ASSERT(v.isArray() || v.isNull() || v.isUndefined()); QStringList l; for( const QJsonValue& e : v.toArray() ) -- cgit v1.2.3