diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-10-04 06:04:31 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-10-04 06:04:31 (GMT) |
commit | da45259dbfa05c4f3b6c8c0472a65851692060e4 (patch) | |
tree | 2ca4b812668dc9cf0d29e1ac53828527b231a3bb | |
parent | 15cf932b3cc93239333694842be808acabae7bb3 (diff) | |
download | Qt-da45259dbfa05c4f3b6c8c0472a65851692060e4.zip Qt-da45259dbfa05c4f3b6c8c0472a65851692060e4.tar.gz Qt-da45259dbfa05c4f3b6c8c0472a65851692060e4.tar.bz2 |
Avoid potential null dereference.
Task-number: QT-4030
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativegridview.cpp | 2 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 8d08c99..8216ab7 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2591,7 +2591,7 @@ void QDeclarativeGridView::itemsMoved(int from, int to, int count) while (moved.count()) { int idx = moved.begin().key(); FxGridItem *item = moved.take(idx); - if (item->item == d->currentItem->item) + if (d->currentItem && item->item == d->currentItem->item) item->setPosition(d->colPosAt(idx), d->rowPosAt(idx)); d->releaseItem(item); } diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index c1e6aaa..6b46bc5 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -3090,7 +3090,7 @@ void QDeclarativeListView::itemsMoved(int from, int to, int count) while (moved.count()) { int idx = moved.begin().key(); FxListItem *item = moved.take(idx); - if (item->item == d->currentItem->item) + if (d->currentItem && item->item == d->currentItem->item) item->setPosition(d->positionAt(idx)); d->releaseItem(item); } |