QJsonValueConstRef: fix null pointer dereferences
Introduced in commit 705ea62f9e
, but
apparently these constructors aren't used anywhere yet.
Change-Id: Ic30914a4448d4bc28974fffd16dc521ab49d3be4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
6492a9c877
commit
03de9ff7ee
@ -271,7 +271,7 @@ Q_DECLARE_SHARED(QJsonArray)
|
|||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
|
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
|
||||||
inline QJsonValueConstRef::QJsonValueConstRef(QJsonArray *a, qsizetype idx)
|
inline QJsonValueConstRef::QJsonValueConstRef(QJsonArray *a, qsizetype idx)
|
||||||
: d(a->a.data()), is_object(false), index(idx)
|
: d(a ? a->a.data() : nullptr), is_object(false), index(idx)
|
||||||
{}
|
{}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -313,7 +313,7 @@ Q_DECLARE_SHARED(QJsonObject)
|
|||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
|
#if QT_VERSION >= QT_VERSION_CHECK(7, 0, 0) || defined(QT_BOOTSTRAPPED)
|
||||||
inline QJsonValueConstRef::QJsonValueConstRef(QJsonObject *o, qsizetype idx)
|
inline QJsonValueConstRef::QJsonValueConstRef(QJsonObject *o, qsizetype idx)
|
||||||
: d(o->o.data()), is_object(true), index(idx)
|
: d(o ? o->o.data() : nullptr), is_object(true), index(idx)
|
||||||
{}
|
{}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user