CMake: Fix potential null deref

Reported by Coverity.

Looks like it cannot really happen in real life though.

Change-Id: I92e09dbe7dc81e694e5450c598c649c956eb7fcc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Orgad Shaneh
2023-01-30 09:43:38 +02:00
committed by Orgad Shaneh
parent a0657f5d60
commit 092209fa84

View File

@@ -747,8 +747,8 @@ void CMakeBuildSystem::handleParsingSucceeded(bool restoredFromBackup)
checkAndReportError(errorMessage);
}
const CMakeTool *tool = m_parameters.cmakeTool();
m_ctestPath = tool->cmakeExecutable().withNewPath(m_reader.ctestPath());
if (const CMakeTool *tool = m_parameters.cmakeTool())
m_ctestPath = tool->cmakeExecutable().withNewPath(m_reader.ctestPath());
setApplicationTargets(appTargets());
setDeploymentData(deploymentData());