From 9037bf4c869cf7e8dc2801d7e126ada24d1ec1e4 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 20 Sep 2016 17:25:04 +0200 Subject: Don't try to index empty values. --- common/typeindex.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'common/typeindex.cpp') diff --git a/common/typeindex.cpp b/common/typeindex.cpp index 78195d3..b96c5b5 100644 --- a/common/typeindex.cpp +++ b/common/typeindex.cpp @@ -27,7 +27,10 @@ SINK_DEBUG_AREA("typeindex") static QByteArray getByteArray(const QVariant &value) { if (value.type() == QVariant::DateTime) { - return value.toDateTime().toString().toLatin1(); + const auto result = value.toDateTime().toString().toLatin1(); + if (result.isEmpty()) { + return "nodate"; + } } if (value.isValid() && !value.toByteArray().isEmpty()) { return value.toByteArray(); -- cgit v1.2.3