summaryrefslogtreecommitdiffstats
path: root/common/indexupdater.h
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-19 20:14:54 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2016-06-19 20:14:54 +0200
commitea4d0708e63b7dc7ee0b1cb150f1e09da1f52046 (patch)
treecde644a4f18f2a27b9a3d511a40c792147be9a2f /common/indexupdater.h
parent8f06f8a31682760b385ba740db28429d7914730a (diff)
downloadsink-ea4d0708e63b7dc7ee0b1cb150f1e09da1f52046.tar.gz
sink-ea4d0708e63b7dc7ee0b1cb150f1e09da1f52046.zip
Don't try to remove empty values from the index.
Indexes don't allow empty keys, so this will always fail.
Diffstat (limited to 'common/indexupdater.h')
-rw-r--r--common/indexupdater.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/common/indexupdater.h b/common/indexupdater.h
index 936d03a..79499c3 100644
--- a/common/indexupdater.h
+++ b/common/indexupdater.h
@@ -55,8 +55,12 @@ private:
55 55
56 void remove(const QVariant &value, const QByteArray &uid, Sink::Storage::Transaction &transaction) 56 void remove(const QVariant &value, const QByteArray &uid, Sink::Storage::Transaction &transaction)
57 { 57 {
58 // TODO hide notfound error 58 if (value.isValid()) {
59 Index(mIndexIdentifier, transaction).remove(value.toByteArray(), uid); 59 const auto data = value.toByteArray();
60 if (!data.isEmpty()) {
61 Index(mIndexIdentifier, transaction).remove(data, uid);
62 }
63 }
60 } 64 }
61 65
62 QByteArray mIndexIdentifier; 66 QByteArray mIndexIdentifier;