aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/variable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/variable.cxx')
-rw-r--r--libbuild2/variable.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/libbuild2/variable.cxx b/libbuild2/variable.cxx
index b0fe32a..1785e56 100644
--- a/libbuild2/variable.cxx
+++ b/libbuild2/variable.cxx
@@ -2080,9 +2080,16 @@ namespace build2
}
}
- return (jv != nullptr
- ? json_subscript_impl (val, val_data, i, n, index)
- : value ());
+ value r (jv != nullptr
+ ? json_subscript_impl (val, val_data, i, n, index)
+ : value ());
+
+ // Typify null values so that we get called for nested subscripts.
+ //
+ if (r.null)
+ r.type = &value_traits<json_value>::value_type;
+
+ return r;
}
void json_iterate (const value& val,