From 4bb71b2142223d4a81a449c6bfcfa22918c6fc90 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Thu, 11 Feb 2016 16:34:38 +0100 Subject: Avoid warnings when trying to write empty keys. --- common/typeindex.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/typeindex.cpp b/common/typeindex.cpp index b1bcf6a..37c0517 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp @@ -36,7 +36,7 @@ void TypeIndex::addProperty(const QByteArray &property) { auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Sink::Storage::Transaction &transaction) { // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); - if (value.isValid()) { + if (value.isValid() && !value.toByteArray().isEmpty()) { Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); } else { Index(mType + ".index." + property, transaction).add("toplevel", identifier); @@ -51,7 +51,7 @@ void TypeIndex::addProperty(const QByteArray &property) { auto indexer = [this, property](const QByteArray &identifier, const QVariant &value, Sink::Storage::Transaction &transaction) { // Trace() << "Indexing " << mType + ".index." + property << value.toByteArray(); - if (value.isValid()) { + if (value.isValid() && !value.toByteArray().isEmpty()) { Index(mType + ".index." + property, transaction).add(value.toByteArray(), identifier); } else { Index(mType + ".index." + property, transaction).add("toplevel", identifier); -- cgit v1.2.3