Don't remove rows if there are no rows

This fixes an assert added in Qt 5.11.
This commit is contained in:
Roland Winklmeier
2018-03-09 09:53:01 +01:00
committed by Klaus Basan
parent 87bb9e28cd
commit 84bb363990

View File

@@ -166,7 +166,9 @@ namespace BlackGui
}
else
{
beginRemoveRows(QModelIndex(), 0, 0);
QModelIndex parent;
if (rowCount(parent) == 0) { return; }
beginRemoveRows(parent, 0, 0);
this->removeIf(&CAtcStation::getCallsign, station.getCallsign());
endRemoveRows();
}