From 84bb363990393245445c23516529553d08772c76 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Fri, 9 Mar 2018 09:53:01 +0100 Subject: [PATCH] Don't remove rows if there are no rows This fixes an assert added in Qt 5.11. --- src/blackgui/models/atcstationlistmodel.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/blackgui/models/atcstationlistmodel.cpp b/src/blackgui/models/atcstationlistmodel.cpp index a203594ef..2e35894fe 100644 --- a/src/blackgui/models/atcstationlistmodel.cpp +++ b/src/blackgui/models/atcstationlistmodel.cpp @@ -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(); }