From ea378fe8374ae8c68cfcfd2043d504a7a0e3c592 Mon Sep 17 00:00:00 2001 From: ckamm Date: Thu, 20 Apr 2017 09:16:55 +0200 Subject: [PATCH] FolderStatusModel: Fix crash for empty relativePath (#5713) 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/folderstatusmodel.cpp b/src/gui/folderstatusmodel.cpp index a4079ff07..42c34d1e4 100644 --- a/src/gui/folderstatusmodel.cpp +++ b/src/gui/folderstatusmodel.cpp @@ -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; -- 2.30.2