mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 05:15:40 +03:00
Attempt to fix a crash in FolderStatusModel::slotUpdateDirectories
The backtrace looks like: File "atomic_base.h", line 396, in QString::~QString File "qlist.h", line 442, in OCC::FolderStatusModel::slotUpdateDirectories This is the only QList operation, and it may crash if the list is empty. It can be empty if the propfind returned empty results. I'm not sure how this can be possible to have an empty list there since the server is always supposed to return at least one entry, for the directory itself. But it can happen if a directory was transformed in a file, or if there is a bug on the server.
This commit is contained in:
parent
881b32521b
commit
8e68e0321c
1 changed files with 2 additions and 2 deletions
|
@ -631,8 +631,8 @@ void FolderStatusModel::slotUpdateDirectories(const QStringList &list)
|
|||
const auto permissionMap = job->property(propertyPermissionMap).toMap();
|
||||
|
||||
QStringList sortedSubfolders = list;
|
||||
// skip the parent item (first in the list)
|
||||
sortedSubfolders.erase(sortedSubfolders.begin());
|
||||
if (!sortedSubfolders.isEmpty())
|
||||
sortedSubfolders.removeFirst(); // skip the parent item (first in the list)
|
||||
Utility::sortFilenames(sortedSubfolders);
|
||||
|
||||
QVarLengthArray<int, 10> undecidedIndexes;
|
||||
|
|
Loading…
Reference in a new issue