From 74e33252549d6a83fab1736e6efdf05858dc459e Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Wed, 24 Apr 2019 20:40:52 +0200 Subject: options: add missing value::is_null() checks --- options/value.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/options/value.hpp b/options/value.hpp index 940e2a15..35cb5616 100644 --- a/options/value.hpp +++ b/options/value.hpp @@ -62,6 +62,9 @@ class value final : public value_ if (traits::is_equal(get(), traits::value_from_qvariant(value))) return; + if (is_null()) + return; + if (value.isValid() && !value.isNull()) b->store_kv(self_name, value); else @@ -97,12 +100,18 @@ public: auto& operator=(t&& datum) noexcept { + if (is_null()) + return *this; + store_variant(traits::qvariant_from_value(traits::pass_value(datum))); return *this; } auto& operator=(const t& datum) noexcept { + if (is_null()) + return *this; + t copy{datum}; *this = std::move(copy); return *this; -- cgit v1.2.3