diff options
author | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2011-01-06 11:25:01 +0100 |
---|---|---|
committer | Lasse Holmstedt <lasse.holmstedt@nokia.com> | 2011-01-06 11:26:01 +0100 |
commit | a6ac1e6c4b9804df54e8e9f6b16d98ae7077e8e7 (patch) | |
tree | 39571da17fd1cf283aa7f4cc20dad05b2b4ee3b4 | |
parent | 6cd3a7c29e2a53996a6ebee8bdfc2545a3e2ca65 (diff) |
Fix crash on QxListView
currentItem was 0 when it was being referenced on line 2734.
-rw-r--r-- | src/graphicsitems/qxlistview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/graphicsitems/qxlistview.cpp b/src/graphicsitems/qxlistview.cpp index 6be8156..d3c6148 100644 --- a/src/graphicsitems/qxlistview.cpp +++ b/src/graphicsitems/qxlistview.cpp @@ -2731,9 +2731,11 @@ void QxListView::itemsRemoved(int modelIndex, int count) emit currentIndexChanged(); } else if (d->currentIndex >= modelIndex && d->currentIndex < modelIndex + count) { // current item has been removed. - d->currentItem->attached->setIsCurrentItem(false); - d->releaseItem(d->currentItem); - d->currentItem = 0; + if (d->currentItem) { + d->currentItem->attached->setIsCurrentItem(false); + d->releaseItem(d->currentItem); + d->currentItem = 0; + } d->currentIndex = -1; if (d->itemCount) d->updateCurrent(qMin(modelIndex, d->itemCount-1)); |