diff --git a/qmake/option.cpp b/qmake/option.cpp index 3fc66a8f3d..ef613b90ad 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -149,8 +149,11 @@ static QString detectProjectFile(const QString &path) static QString cleanSpec(const QString &spec) { QString ret = QDir::cleanPath(spec); - if (ret.contains('/')) - ret = QDir::cleanPath(QFileInfo(ret).absoluteFilePath()); + if (ret.contains('/')) { + const QFileInfo specDirInfo(ret); + if (specDirInfo.exists() && specDirInfo.isDir()) + ret = QDir::cleanPath(specDirInfo.absoluteFilePath()); + } return ret; }