From de8ae1e75bbe0b429647db7da758a51323385e57 Mon Sep 17 00:00:00 2001 From: Marcus Eggenberger Date: Wed, 1 Oct 2008 00:29:41 +0200 Subject: [PATCH] fixing crash on disconnect --- src/qtui/chatscene.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/qtui/chatscene.cpp b/src/qtui/chatscene.cpp index a5f624be..7ba9ada9 100644 --- a/src/qtui/chatscene.cpp +++ b/src/qtui/chatscene.cpp @@ -240,6 +240,10 @@ void ChatScene::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int e // update sceneRect // when searching for the first non-date-line we have to take into account that our // model still contains the just removed lines so we cannot simply call updateSceneRect() + if(_lines.isEmpty()) { + updateSceneRect(QRectF(0, 0, _sceneRect.width(), 0)); + return; + } int numRows = model()->rowCount(); QModelIndex firstLineIdx; int row = -1; -- 2.20.1