forked from qt-creator/qt-creator
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:
@@ -60,6 +60,9 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName)
|
|||||||
return fileType(fileName.mid(pos));
|
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));
|
Q_ASSERT(fileName.isEmpty() || isAbsolutePath(fileName));
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());
|
DWORD attr = GetFileAttributesW((WCHAR*)fileName.utf16());
|
||||||
|
Reference in New Issue
Block a user