FolderStatusModel: Fix crash for empty relativePath (#5713)
authorckamm <mail@ckamm.de>
Thu, 20 Apr 2017 07:16:55 +0000 (09:16 +0200)
committerMarkus Goetz <markus@woboq.com>
Thu, 20 Apr 2017 07:16:55 +0000 (09:16 +0200)
The problem was that split("", SkipEmptyParts) is the empty list.

See
https://sentry.io/owncloud/desktop-win-and-mac/issues/251167186/

src/gui/folderstatusmodel.cpp

index a4079ff07ce6648943bd3521cd4efacd85893b03..42c34d1e4f3412936faca2b18bcebbcc5accf2e7 100644 (file)
@@ -652,7 +652,7 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
         newInfo._size = job->_sizes.value(path);
         newInfo._isExternal = permissionMap.value(removeTrailingSlash(path)).toString().contains("M");
         newInfo._path = relativePath;
-        newInfo._name = relativePath.split('/', QString::SkipEmptyParts).last();
+        newInfo._name = removeTrailingSlash(relativePath).split('/').last();
 
         if (relativePath.isEmpty())
             continue;