Index: src/core/kmountpoint.cpp =================================================================== --- src/core/kmountpoint.cpp +++ src/core/kmountpoint.cpp @@ -416,16 +416,19 @@ { #ifndef Q_OS_WIN /* If the path contains symlinks, get the real name */ - QFileInfo fileinfo(path); + QFileInfo fileinfo = Q_UNLIKELY(path.isEmpty()) ? QFileInfo() : QFileInfo(path); const QString realname = fileinfo.exists() ? fileinfo.canonicalFilePath() : fileinfo.absolutePath(); //canonicalFilePath won't work unless file exists #else const QString realname = QDir::fromNativeSeparators(QDir(path).absolutePath()); #endif - int max = 0; KMountPoint::Ptr result; + if (Q_UNLIKELY(realname.isEmpty())) { + return result; + } + int max = 0; for (const_iterator it = begin(); it != end(); ++it) { const QString mountpoint = (*it)->d->mountPoint; const int length = mountpoint.length();