projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
412b531
)
Make sure NickView::customEvent() has a valid model
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Mon, 9 Nov 2009 00:44:24 +0000
(
01:44
+0100)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Mon, 9 Nov 2009 00:44:24 +0000
(
01:44
+0100)
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
patch
|
blob
|
history
diff --git
a/src/uisupport/nickview.cpp
b/src/uisupport/nickview.cpp
index
6d3f398
..
11b40c7
100644
(file)
--- 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());