From: Manuel Nickschas Date: Mon, 9 Nov 2009 00:44:24 +0000 (+0100) Subject: Make sure NickView::customEvent() has a valid model X-Git-Tag: 0.6-beta1~183 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=f0502bc0352f04ba9146601f802ddeed8a9b907b Make sure NickView::customEvent() has a valid model We've gotten backtraces that indicate crashes in this method, and all that I can see could be wrong is an invalid model() pointer. Can't really explain that for now, but let's introduce a check just to make sure. --- diff --git a/src/uisupport/nickview.cpp b/src/uisupport/nickview.cpp index 6d3f3981..11b40c72 100644 --- a/src/uisupport/nickview.cpp +++ b/src/uisupport/nickview.cpp @@ -144,6 +144,9 @@ void NickView::customEvent(QEvent *event) { if(event->type() != QEvent::User) return; + if(!model()) + return; + QModelIndex topLevelIdx; for(int i = 0; i < model()->rowCount(rootIndex()); i++) { topLevelIdx = model()->index(i, 0, rootIndex());