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

Proposed by Cris Dywan
Status: Merged
Approved by: Kevin Wright
Approved revision: 69
Merged at revision: 69
Proposed branch: lp:~kalikiana/u1db-qt/query-crash-fix
Merge into: lp:u1db-qt
Diff against target: 35 lines (+14/-0)
2 files modified
query.cpp (+3/-0)
tests/tst_database.qml (+11/-0)
To merge this branch: bzr merge lp:~kalikiana/u1db-qt/query-crash-fix
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Kevin Wright Approve
Review via email: mp+158574@code.launchpad.net

Commit message

Bail out of dataInvalidated if index is unset

Description of the change

Bail out of dataInvalidated if index is unset

To post a comment you must log in.
Revision history for this message
Kevin Wright (kevin-wright-1) wrote :

Confirmed.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'query.cpp'
2--- query.cpp 2013-04-06 02:14:24 +0000
3+++ query.cpp 2013-04-12 11:53:35 +0000
4@@ -107,6 +107,9 @@
5 {
6 m_hash.clear();
7
8+ if (!m_index)
9+ return;
10+
11 Database *db = m_index->getDatabase();
12 if(db){
13 if(db->documentCount>0){
14
15=== modified file 'tests/tst_database.qml'
16--- tests/tst_database.qml 2013-04-09 11:32:11 +0000
17+++ tests/tst_database.qml 2013-04-12 11:53:35 +0000
18@@ -72,6 +72,17 @@
19 range: [['a', 'b'], ['*']]
20 }
21
22+ U1db.Query {
23+ id: allQuery
24+ index: myIndex
25+ query: '*'
26+ }
27+
28+ U1db.Query {
29+ id: defaultAllQuery
30+ index: myIndex
31+ }
32+
33 ListView {
34 id: myList
35 model: myDatabase

Subscribers

People subscribed via source and target branches

to all changes: