diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-13 09:48:24 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2016-06-13 09:48:24 +0200 |
commit | 29cca3919ed373c486c3c9acec32481918baeb58 (patch) | |
tree | 787e14ca37783f798682b09c199fdd108e705585 /common/query.cpp | |
parent | 1e2e4437094d80f1cdd849c7341019910fc29fb1 (diff) | |
download | sink-29cca3919ed373c486c3c9acec32481918baeb58.tar.gz sink-29cca3919ed373c486c3c9acec32481918baeb58.zip |
Don't match invalid properties.
Diffstat (limited to 'common/query.cpp')
-rw-r--r-- | common/query.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/query.cpp b/common/query.cpp index 5f93c82..75d2a2e 100644 --- a/common/query.cpp +++ b/common/query.cpp | |||
@@ -50,8 +50,14 @@ bool Query::Comparator::matches(const QVariant &v) const | |||
50 | { | 50 | { |
51 | switch(comparator) { | 51 | switch(comparator) { |
52 | case Equals: | 52 | case Equals: |
53 | if (!v.isValid()) { | ||
54 | return false; | ||
55 | } | ||
53 | return v == value; | 56 | return v == value; |
54 | case Contains: | 57 | case Contains: |
58 | if (!v.isValid()) { | ||
59 | return false; | ||
60 | } | ||
55 | return v.value<QByteArrayList>().contains(value.toByteArray()); | 61 | return v.value<QByteArrayList>().contains(value.toByteArray()); |
56 | default: | 62 | default: |
57 | break; | 63 | break; |