fix: extraction of null optional values

This commit is contained in:
CJ van den Berg 2025-08-08 12:45:58 +02:00
parent 451bc20dde
commit ba2955fe3a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -1244,6 +1244,10 @@ fn Extractor(comptime T: type) type {
},
.optional => |opt_info| {
var nested: opt_info.child = undefined;
if (try matchNull(iter)) {
self.dest.* = null;
return true;
}
const extractor = Extractor(opt_info.child).init(&nested);
if (try extractor.extract(iter)) {
self.dest.* = nested;