fix crash when using ALDI usb-stick with broken filesystem

I was using a cheap usb-stick from ALDI supermarket with fat32,
and my application crashed because filesystem was empty.

Unrealistic scenario, but still just returning here false is better
than a crash

Change-Id: I8979d5a4e19ce57770ab03983e847b272ebf7019
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Nick Shaforostov 2018-09-26 17:16:10 +02:00
parent 4d5fb551d6
commit 5d76529580

View File

@ -320,7 +320,8 @@ void QDirIteratorPrivate::checkAndPushDirectory(const QFileInfo &fileInfo)
bool QDirIteratorPrivate::matchesFilters(const QString &fileName, const QFileInfo &fi) const
{
Q_ASSERT(!fileName.isEmpty());
if (fileName.isEmpty())
return false;
// filter . and ..?
const int fileNameSize = fileName.size();