fixing BR #302 - client crash on disconnect
authorMarcus Eggenberger <egs@quassel-irc.org>
Fri, 29 Aug 2008 17:41:14 +0000 (19:41 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 30 Aug 2008 10:16:37 +0000 (12:16 +0200)
src/qtui/chatscene.cpp

index 5f6032c..d16e19c 100644 (file)
@@ -181,7 +181,9 @@ void ChatScene::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e
     }
     setSceneRect(QRectF(0, 0, _width, _height));
     emit heightChanged(_height);
-    emit heightChangedAt(_lines.at(start)->y(), -h);
+    Q_ASSERT(_lines.isEmpty() || (start < _lines.count())); // if _lines isn't empty it better contain start
+    qreal changePos = (_lines.isEmpty()) ? 0 : _lines.at(start)->y();
+    emit heightChangedAt(changePos, -h);
   }
 }