From: Manuel Nickschas Date: Tue, 22 Jan 2008 01:21:00 +0000 (+0000) Subject: Prevent Quassel from crashing on displaying empty messages. Now we'll need to find out X-Git-Tag: 0.2.0-alpha1~209 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=dcd1ffa954d7b1a582dd45a1c4ca37bdacb92990 Prevent Quassel from crashing on displaying empty messages. Now we'll need to find out where these are coming from anyway, in particular after CTCP ACTION :) --- diff --git a/src/qtui/chatline-old.cpp b/src/qtui/chatline-old.cpp index d2f55be9..0a0d0dbc 100644 --- a/src/qtui/chatline-old.cpp +++ b/src/qtui/chatline-old.cpp @@ -345,6 +345,7 @@ void ChatLine::draw(QPainter *p, const QPointF &pos) { } QPointF tpos = pos + QPointF(tsWidth + QtUi::style()->sepTsSender() + senderWidth + QtUi::style()->sepSenderText(), 0); qreal h = 0; int l = 0; + if(lineLayouts.count() == 0) return; // how can this happen? rect = QRectF(tpos + QPointF(0, h), QSizeF(textWidth, lineLayouts[l].height)); int offset = 0; foreach(FormatRange fr, textFormat) {