From: ckamm Date: Thu, 20 Apr 2017 07:16:55 +0000 (+0200) Subject: FolderStatusModel: Fix crash for empty relativePath (#5713) X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~722^2~34 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=ea378fe8374ae8c68cfcfd2043d504a7a0e3c592;p=nextcloud-desktop.git 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/ --- 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;