Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
5.4.0 Alpha
-
None
-
c8edde3b833cb3d15377afed13d6fcd2e5fa5cd9
Description
The documented behavior for QJsonObject::value(const QString &key) is that an Undefined QJsonValue is returned when the key does not exist.
When a QJsonObject is uninitialized (which means the d member is still null), the returned value is Null instead of Undefined.
The behavior is caused directly by the QJsonObject::value() method, containing these lines:
QJsonValue QJsonObject::value(const QString &key) const { if (!d) return QJsonValue(); [...] }