diff options
author | Warwick Allison <warwick.allison@nokia.com> | 2009-11-19 05:34:04 (GMT) |
---|---|---|
committer | Warwick Allison <warwick.allison@nokia.com> | 2009-11-19 05:34:04 (GMT) |
commit | 8f6453c94a9fb146b3f44f66677a3d4579b2583b (patch) | |
tree | 7d48c753bd7736d347f82edde65e4c1e6e536493 /src/declarative/qml | |
parent | adb1994279333ff7356790649548d62f623739ac (diff) | |
download | Qt-8f6453c94a9fb146b3f44f66677a3d4579b2583b.zip Qt-8f6453c94a9fb146b3f44f66677a3d4579b2583b.tar.gz Qt-8f6453c94a9fb146b3f44f66677a3d4579b2583b.tar.bz2 |
Fix for empty query results.
Diffstat (limited to 'src/declarative/qml')
-rw-r--r-- | src/declarative/qml/qmlsqldatabase.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/declarative/qml/qmlsqldatabase.cpp b/src/declarative/qml/qmlsqldatabase.cpp index 9e4c198..21ca145 100644 --- a/src/declarative/qml/qmlsqldatabase.cpp +++ b/src/declarative/qml/qmlsqldatabase.cpp @@ -107,8 +107,11 @@ public: int s = query.size(); if (s<0) { // Inefficient. - query.last(); - return query.at()+1; + if (query.last()) { + return query.at()+1; + } else { + return 0; + } } else { return s; } |