river-options: fix setting null string options

This commit is contained in:
Isaac Freund 2021-02-02 18:16:36 +01:00
parent 7029a5cd3e
commit 1834bd4bd0
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11

View file

@ -89,7 +89,7 @@ pub fn set(self: *Self, value: Value) !void {
};
} else if (self.value == .string and
// TODO: std.mem needs a good way to compare optional sentinel pointers
((self.value.string == null and value.string == null) or
(((self.value.string == null) != (value.string == null)) or
(self.value.string != null and value.string != null and
std.cstr.cmp(self.value.string.?, value.string.?) != 0)))
{