mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-10-02 09:31:12 -04:00
Prevent crash when trying to remove -1 rows in netlauncher
This commit is contained in:
parent
b1bcba3055
commit
ba493435f3
@ -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…
x
Reference in New Issue
Block a user