summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesus Fernandez <jesus.fernandez@qt.io>2018-02-12 10:50:01 +0100
committerJesus Fernandez <Jesus.Fernandez@qt.io>2018-02-12 10:34:46 +0000
commit9c3c479193ec1bb02732c762fd5c4501b0a7933a (patch)
tree76656d0021e19b32fbaaaeb201fd1c84ed5deffa
parent2a29dec5f56b921c1ff7090f837ec24b3f9dd5a5 (diff)
Remove null pointer check
>>> CID 187918: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "node" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. Change-Id: Ic799724e91d118a2c5b2715c5742a4184b09a217 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/core/changes/qpropertynodeaddedchange.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/changes/qpropertynodeaddedchange.cpp b/src/core/changes/qpropertynodeaddedchange.cpp
index 9f8e50872..90343493a 100644
--- a/src/core/changes/qpropertynodeaddedchange.cpp
+++ b/src/core/changes/qpropertynodeaddedchange.cpp
@@ -75,6 +75,7 @@ QPropertyNodeAddedChange::QPropertyNodeAddedChange(QNodeId subjectId, QNode *nod
: QStaticPropertyValueAddedChangeBase(*new QPropertyNodeAddedChangePrivate, subjectId)
{
Q_D(QPropertyNodeAddedChange);
+ Q_ASSERT(node);
d->m_addedNodeIdTypePair = QNodeIdTypePair(node->id(), QNodePrivate::findStaticMetaObject(node->metaObject()));
// Ensure the node has issued a node creation change. We can end
@@ -84,8 +85,7 @@ QPropertyNodeAddedChange::QPropertyNodeAddedChange(QNodeId subjectId, QNode *nod
// loop will still be blocked. So force it here and we catch this
// eventuality in the _q_postConstructorInit() function so that we
// do not repeat the creation and new child scene change events.
- if (node)
- QNodePrivate::get(node)->_q_postConstructorInit();
+ QNodePrivate::get(node)->_q_postConstructorInit();
}
/*! \internal */