path: root/src
diff options
authorNick Shaforostov <>2018-09-26 17:16:10 +0200
committerNick Shaforostov <>2019-05-05 09:15:25 +0000
commit5d76529580b72ead582b6e09112b5b94c0b11113 (patch)
tree6e8f4e3604acfbc241bfd6555b8986f1d0396b37 /src
parent4d5fb551d6bcf32d74459ab378c231914c48ab10 (diff)
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 <>
Diffstat (limited to 'src')
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/io/qdiriterator.cpp b/src/corelib/io/qdiriterator.cpp
index 648593b020..ccde9745bf 100644
--- a/src/corelib/io/qdiriterator.cpp
+++ b/src/corelib/io/qdiriterator.cpp
@@ -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();