From f0502bc0352f04ba9146601f802ddeed8a9b907b Mon Sep 17 00:00:00 2001 From: Manuel Nickschas Date: Mon, 9 Nov 2009 01:44:24 +0100 Subject: [PATCH 1/1] 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. --- src/uisupport/nickview.cpp | 3 +++ 1 file changed, 3 insertions(+) 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()); -- 2.20.1