@cryptotaxi247 / netdata-1 / commits / 645355ef1

fix(jsonwrap): handle potential null keys (#22326)

* fix(jsonwrap): handle potential null keys and dictionary set failures * address comments * fix(jsonwrap): Add dev mode error message logging

Stelios Fragkakis committed Apr 30, 2026 at 17:07 UTC 645355ef170b6de6109f23df9e73a5e8183b3747
1 file changed +6
src/web/api/formatters/jsonwrap-summary-dimensions.c
+6
@@ -132,6 +132,12 @@ void query_target_summary_dimensions_v12(BUFFER *wb, QUERY_TARGET *qt, const cha
132
133 if(v2) {
134 k = rrdmetric_acquired_name(rma);
135 + if(unlikely(!k || !*k))
136 + k = rrdmetric_acquired_id(rma);
137 + if(unlikely(!k || !*k)) {
138 + internal_error(true, "QUERY: dimension at index %ld has empty id and name; skipping it", c);
139 + continue;
140 + }
141 id = k;
142 name = k;
143 }