Prevent crash when trying to remove -1 rows in netlauncher

This commit is contained in:
David Cernat 2017-01-14 17:54:50 +02:00
parent b1bcba3055
commit ba493435f3

View file

@ -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();