← Back to team overview

uonedb-qt team mailing list archive

[Merge] lp:~kalikiana/u1db-qt/query-crash-fix into lp:u1db-qt

 

Christian Dywan has proposed merging lp:~kalikiana/u1db-qt/query-crash-fix into lp:u1db-qt.

Commit message:
Bail out of dataInvalidated if index is unset

Requested reviews:
  U1DB Qt developers (uonedb-qt)

For more details, see:
https://code.launchpad.net/~kalikiana/u1db-qt/query-crash-fix/+merge/158574

Bail out of dataInvalidated if index is unset
-- 
https://code.launchpad.net/~kalikiana/u1db-qt/query-crash-fix/+merge/158574
Your team U1DB Qt developers is requested to review the proposed merge of lp:~kalikiana/u1db-qt/query-crash-fix into lp:u1db-qt.
=== modified file 'query.cpp'
--- query.cpp	2013-04-06 02:14:24 +0000
+++ query.cpp	2013-04-12 11:53:35 +0000
@@ -107,6 +107,9 @@
 {
     m_hash.clear();
 
+    if (!m_index)
+        return;
+
     Database *db = m_index->getDatabase();
     if(db){
         if(db->documentCount>0){

=== modified file 'tests/tst_database.qml'
--- tests/tst_database.qml	2013-04-09 11:32:11 +0000
+++ tests/tst_database.qml	2013-04-12 11:53:35 +0000
@@ -72,6 +72,17 @@
         range: [['a', 'b'], ['*']]
     }
 
+    U1db.Query {
+        id: allQuery
+        index: myIndex
+        query: '*'
+    }
+
+    U1db.Query {
+        id: defaultAllQuery
+        index: myIndex
+    }
+
     ListView {
         id: myList
         model: myDatabase