ProParser: Avoid the most common hard crash

Whenever we try to access a non-local file we no more
hard crash Qt Creator, instead we silently handle it as
not found.

Change-Id: I3cbc617093c2a6fcb30626e276996430bb3795e5
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Stenger
2021-07-23 11:20:08 +02:00
parent b8bcdd9568
commit 5d5969b46c

View File

@@ -60,6 +60,9 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName)
return fileType(fileName.mid(pos));
}
if (!QFileInfo::exists(fileName)) // FIXME make pro parser work with non-local
return FileNotFound;
Q_ASSERT(fileName.isEmpty() || isAbsolutePath(fileName));
#ifdef Q_OS_WIN
DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());