Skip to content

Commit 6f2e969

Browse files
committed
Fixes #13962: fi can be nullptr
1 parent 129055d commit 6f2e969

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/cppcheck.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2090,8 +2090,10 @@ unsigned int CppCheck::analyseWholeProgram(const std::string &buildDir, const st
20902090
for (const Check *check : Check::instances()) {
20912091
if (checkClassAttr == check->name()) {
20922092
Check::FileInfo* fi = check->loadFileInfoFromXml(e);
2093-
fi->file0 = filesTxtInfo.sourceFile;
2094-
fileInfoList.push_back(fi);
2093+
if (fi) {
2094+
fi->file0 = filesTxtInfo.sourceFile;
2095+
fileInfoList.push_back(fi);
2096+
}
20952097
}
20962098
}
20972099
}

0 commit comments

Comments
 (0)