Null pointer access has been fixed

This commit is contained in:
Arin Alexander 2017-03-03 01:12:29 +03:00
parent 9ab3cb5803
commit 322ded3659

View File

@ -520,8 +520,11 @@ QString ScriptEngineManager::expandDataFields(QString context, ExpandType expand
context.replace(rx.cap(0),fieldValue);
} else {
QString error = QString("Field %1 not found in %2 !!! ").arg(field).arg(reportItem->objectName());
dataManager()->putError(error);
QString error;
if (reportItem){
error = QString("Field %1 not found in %2 !!! ").arg(field).arg(reportItem->objectName());
dataManager()->putError(error);
}
varValue = QVariant();
if (!dataManager()->reportSettings() || !dataManager()->reportSettings()->suppressAbsentFieldsAndVarsWarnings())
context.replace(rx.cap(0),error);