Pack QMetaType::Nullptr QVariant's as nil.

This commit is contained in:
Roman Isaikin
2019-06-30 09:03:04 +03:00
parent efc99ef590
commit a9e429a30f
2 changed files with 15 additions and 1 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ QReadWriteLock MsgPackPrivate::packers_lock;
quint8 *MsgPackPrivate::pack(const QVariant &v, quint8 *p, bool wr, QVector<QByteArray> &user_data)
{
QMetaType::Type t = (QMetaType::Type)v.type();
if (v.isNull() && !v.isValid())
if ((v.isNull() && !v.isValid()) || t == QMetaType::Nullptr)
p = pack_nil(p, wr);
else if (t == QMetaType::Int)
p = pack_int(v.toInt(), p, wr);