forked from qt-creator/qt-creator
QmakePM: Fix potential null dereference
Reported by Coverity. Change-Id: Ibdb47a711aca4989b22a7f94fd905deff86cb27c Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
631e2c2a4a
commit
c2cceee844
@@ -1134,13 +1134,14 @@ QString InternalLibraryDetailsController::snippet() const
|
|||||||
const QString proRelavitePath = rootDir.relativeFilePath(proFile().toString());
|
const QString proRelavitePath = rootDir.relativeFilePath(proFile().toString());
|
||||||
|
|
||||||
// project for which we insert the snippet
|
// project for which we insert the snippet
|
||||||
const Project *project = SessionManager::projectForFile(proFile());
|
|
||||||
|
|
||||||
// the build directory of the active build configuration
|
// the build directory of the active build configuration
|
||||||
QDir rootBuildDir = rootDir; // If the project is unconfigured use the project dir
|
QDir rootBuildDir = rootDir; // If the project is unconfigured use the project dir
|
||||||
|
if (const Project *project = SessionManager::projectForFile(proFile())) {
|
||||||
if (ProjectExplorer::Target *t = project->activeTarget())
|
if (ProjectExplorer::Target *t = project->activeTarget())
|
||||||
if (ProjectExplorer::BuildConfiguration *bc = t->activeBuildConfiguration())
|
if (ProjectExplorer::BuildConfiguration *bc = t->activeBuildConfiguration())
|
||||||
rootBuildDir.setPath(bc->buildDirectory().toString());
|
rootBuildDir.setPath(bc->buildDirectory().toString());
|
||||||
|
}
|
||||||
|
|
||||||
// the project for which we insert the snippet inside build tree
|
// the project for which we insert the snippet inside build tree
|
||||||
QFileInfo pfi(rootBuildDir.filePath(proRelavitePath));
|
QFileInfo pfi(rootBuildDir.filePath(proRelavitePath));
|
||||||
|
Reference in New Issue
Block a user