ClangCodeModel: fix null pointer access

Change-Id: I2c9e4dc04b7b27986eb0a3a74d8fa6879715df87
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
David Schulz
2022-10-19 09:48:43 +02:00
committed by Christian Kandeler
parent 14938b3881
commit 938e9cab0f
2 changed files with 14 additions and 5 deletions

View File

@@ -166,8 +166,9 @@ GenerateCompilationDbResult generateCompilationDB(QList<ProjectInfo::ConstPtr> p
const UsePrecompiledHeaders usePch = getPchUsage();
const QJsonArray jsonProjectOptions = QJsonArray::fromStringList(projectOptions);
for (const ProjectInfo::ConstPtr &projectInfo : std::as_const(projectInfoList)) {
QTC_ASSERT(projectInfo, continue);
for (ProjectPart::ConstPtr projectPart : projectInfo->projectParts()) {
QTC_ASSERT(projectInfo, continue);
QTC_ASSERT(projectPart, continue);
QStringList args;
const CompilerOptionsBuilder optionsBuilder = clangOptionsBuilder(
*projectPart, warningsConfig, clangIncludeDir, {});