From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Thu, 16 Jan 2020 10:30:51 +0000 (+0100) Subject: Add check if applist rowCount() already empty to prevent assert exception X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~222^2^2~413^2~22 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=9f259bda2734d73ae6d5c4f9b34b47fcf590266b;p=nextcloud-desktop.git Add check if applist rowCount() already empty to prevent assert exception Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- diff --git a/src/gui/tray/UserModel.cpp b/src/gui/tray/UserModel.cpp index 08b679e51..ae9b42653 100644 --- a/src/gui/tray/UserModel.cpp +++ b/src/gui/tray/UserModel.cpp @@ -779,9 +779,11 @@ UserAppsModel::UserAppsModel(QObject *parent) void UserAppsModel::buildAppList() { - beginRemoveRows(QModelIndex(), 0, rowCount()); - _apps.clear(); - endRemoveRows(); + if (rowCount() > 0) { + beginRemoveRows(QModelIndex(), 0, rowCount() - 1); + _apps.clear(); + endRemoveRows(); + } if(UserModel::instance()->appList().count() > 0) { foreach(AccountApp *app, UserModel::instance()->appList()) {