Add Q_ASSERT before dereference pointer

Fix Null pointer dereferences  (NULL_RETURNS)
CID 176640:  Null pointer dereferences  (NULL_RETURNS)
Assigning: "p" = null return value from "value".

Change-Id: I3af9aae3bbebd6f4de90854ba56cd601669b1b5a
Coverity-Id: 176640
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Jesus Fernandez 2017-02-12 11:42:31 +01:00 committed by Jesus Fernandez
parent 1cbf402ea6
commit 5fcdb6c459

View File

@ -1151,6 +1151,7 @@ void WriteInitialization::writeProperties(const QString &varName,
DomPropertyMap properties = propertyMap(lst);
if (properties.contains(QLatin1String("control"))) {
DomProperty *p = properties.value(QLatin1String("control"));
Q_ASSERT( p );
m_output << m_indent << varName << "->setControl("
<< writeString(toString(p->elementString()), m_dindent) << ");\n";
}