summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibSQL
diff options
context:
space:
mode:
authorJan de Visser <jan@de-visser.net>2021-11-02 16:45:22 -0400
committerAndreas Kling <kling@serenityos.org>2021-11-10 14:47:49 +0100
commit87f4c1677bd45366e2e6ebff0dd6c5e84f254482 (patch)
tree38110368a4ebc0be7cc626d3a7ba3810c9c9d59e /Userland/Libraries/LibSQL
parent1c50e9aadcb16ac5963013444392bab21155bad3 (diff)
downloadserenity-87f4c1677bd45366e2e6ebff0dd6c5e84f254482.zip
LibSQL: Relax assignment rules for Null Values
It should be possible to assign a Value of any type to a Value which currently is Null.
Diffstat (limited to 'Userland/Libraries/LibSQL')
-rw-r--r--Userland/Libraries/LibSQL/Value.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibSQL/Value.cpp b/Userland/Libraries/LibSQL/Value.cpp
index 6eb6bdd6b8..6553a945c7 100644
--- a/Userland/Libraries/LibSQL/Value.cpp
+++ b/Userland/Libraries/LibSQL/Value.cpp
@@ -261,6 +261,8 @@ Value& Value::operator=(Value const& other)
if (this != &other) {
if (other.is_null()) {
assign(null());
+ } else if (is_null()) {
+ assign(other);
} else {
VERIFY(can_cast(other));
assign(other);