diff options
author | Yann Bodson <yann.bodson@nokia.com> | 2009-07-16 01:13:27 (GMT) |
---|---|---|
committer | Yann Bodson <yann.bodson@nokia.com> | 2009-07-16 01:13:27 (GMT) |
commit | 8e31e21bb4fc5630706cd21a4a74251c41563adb (patch) | |
tree | 634b96cf41ad3ab62ede3c699194d749ce69dd97 | |
parent | bcae9d84fb5dd2bdc5a5298c8841702505a02867 (diff) | |
download | Qt-8e31e21bb4fc5630706cd21a4a74251c41563adb.zip Qt-8e31e21bb4fc5630706cd21a4a74251c41563adb.tar.gz Qt-8e31e21bb4fc5630706cd21a4a74251c41563adb.tar.bz2 |
Do not segfault when index == -1.
-rw-r--r-- | src/declarative/extra/qmlfolderlistmodel.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/declarative/extra/qmlfolderlistmodel.cpp b/src/declarative/extra/qmlfolderlistmodel.cpp index acee5e1..4a71109 100644 --- a/src/declarative/extra/qmlfolderlistmodel.cpp +++ b/src/declarative/extra/qmlfolderlistmodel.cpp @@ -161,7 +161,9 @@ void QmlFolderListModel::classComplete() bool QmlFolderListModel::isFolder(int index) const { Q_D(const QmlFolderListModel); - return d->model.isDir(d->model.index(index, 0, d->folderIndex)); + if (index != -1) + return d->model.isDir(d->model.index(index, 0, d->folderIndex)); + return false; } void QmlFolderListModel::refresh() |