From ba493435f34d9b990b70a7b22cd45612568a1074 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sat, 14 Jan 2017 17:54:50 +0200 Subject: [PATCH] Prevent crash when trying to remove -1 rows in netlauncher --- apps/netlauncher/ServerModel.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/netlauncher/ServerModel.cpp b/apps/netlauncher/ServerModel.cpp index 4c82f5d8a..f0f41ac93 100644 --- a/apps/netlauncher/ServerModel.cpp +++ b/apps/netlauncher/ServerModel.cpp @@ -162,6 +162,9 @@ bool ServerModel::insertRows(int position, int count, const QModelIndex &index) bool ServerModel::removeRows(int position, int count, const QModelIndex &parent) { + if (count == 0) + return false; + beginRemoveRows(parent, position, position + count - 1); myData.erase(myData.begin()+position, myData.begin() + position + count); endRemoveRows();