From 9f259bda2734d73ae6d5c4f9b34b47fcf590266b Mon Sep 17 00:00:00 2001 From: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> Date: Thu, 16 Jan 2020 11:30:51 +0100 Subject: [PATCH] Add check if applist rowCount() already empty to prevent assert exception Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com> --- src/gui/tray/UserModel.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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()) { -- 2.30.2