forked from mirror/openmw-tes3mp
Prevent crash when trying to remove -1 rows in netlauncher
This commit is contained in:
parent
b1bcba3055
commit
ba493435f3
1 changed files with 3 additions and 0 deletions
|
@ -162,6 +162,9 @@ bool ServerModel::insertRows(int position, int count, const QModelIndex &index)
|
||||||
|
|
||||||
bool ServerModel::removeRows(int position, int count, const QModelIndex &parent)
|
bool ServerModel::removeRows(int position, int count, const QModelIndex &parent)
|
||||||
{
|
{
|
||||||
|
if (count == 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
beginRemoveRows(parent, position, position + count - 1);
|
beginRemoveRows(parent, position, position + count - 1);
|
||||||
myData.erase(myData.begin()+position, myData.begin() + position + count);
|
myData.erase(myData.begin()+position, myData.begin() + position + count);
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
|
|
Loading…
Reference in a new issue