From c9715db7202ec4bc69dd3c673597aee74ecf2b07 Mon Sep 17 00:00:00 2001 From: Felix Weilbach Date: Tue, 18 May 2021 10:50:56 +0200 Subject: [PATCH] Check if first is not empty If it's not checked that first is empty, crashes may happen. Signed-off-by: Felix Weilbach --- src/libsync/discovery.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 65a3d18eb..da6f48bff 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -177,7 +177,7 @@ void ProcessDirectoryJob::process() // For windows, the hidden state is also discovered within the vio // local stat function. // Recall file shall not be ignored (#4420) - bool isHidden = e.localEntry.isHidden || (f.first[0] == '.' && f.first != QLatin1String(".sys.admin#recall#")); + bool isHidden = e.localEntry.isHidden || (!f.first.isEmpty() && f.first[0] == '.' && f.first != QLatin1String(".sys.admin#recall#")); #ifdef Q_OS_WIN // exclude ".lnk" files as they are not essential, but, causing troubles when enabling the VFS due to QFileInfo::isDir() and other methods are freezing, which causes the ".lnk" files to start hydrating and freezing the app eventually. const bool isServerEntryWindowsShortcut = !e.localEntry.isValid() && e.serverEntry.isValid() && !e.serverEntry.isDirectory && FileSystem::isLnkFile(e.serverEntry.name);