Skip to content

Commit daf2d50

Browse files
committed
catch NULLs
1 parent 64bd0fb commit daf2d50

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/data/value/methods/binary.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,16 @@ comparative_binary_ops!(
116116

117117
impl Value {
118118
pub fn string_concat(self, other: Self) -> Result<Self> {
119-
Ok(format!(
120-
"{}{}",
121-
String::convert_from(self)?,
122-
String::convert_from(other)?
123-
)
124-
.into())
119+
if matches!(self, Value::Null) || matches!(other, Value::Null) {
120+
Ok(Value::Null)
121+
} else {
122+
Ok(format!(
123+
"{}{}",
124+
String::convert_from(self)?,
125+
String::convert_from(other)?
126+
)
127+
.into())
128+
}
129+
125130
}
126131
}

0 commit comments

Comments
 (0)