summaryrefslogtreecommitdiffhomepage
path: root/options
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2019-04-24 20:40:52 +0200
committerStanislaw Halik <sthalik@misaki.pl>2019-04-24 20:40:52 +0200
commit74e33252549d6a83fab1736e6efdf05858dc459e (patch)
treeafa757c0efe5d1327309f90814283422da87582d /options
parent79c718d7e0cf9e72e6c5f645b9335fa02cc494ec (diff)
options: add missing value::is_null() checks
Diffstat (limited to 'options')
-rw-r--r--options/value.hpp9
1 files changed, 9 insertions, 0 deletions
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;