@yuneta/gobj-js 7.25.6 → 7.25.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3977,7 +3977,12 @@ function kw_set_dict_value(gobj, kw, path, value) {
3977
3977
  let key = ss[i];
3978
3978
  if (i === len - 1) kw[key] = value;
3979
3979
  else {
3980
- if (kw[key] === void 0) kw[key] = {};
3980
+ let seg = kw[key];
3981
+ if (seg === void 0) kw[key] = {};
3982
+ else if (!is_object(seg) && !is_array(seg)) {
3983
+ log_error(`${gobj ? gobj_short_name(gobj) + ": " : ""}kw_set_dict_value(): segment '${key}' is not a dict or a list: '${path}'`);
3984
+ return -1;
3985
+ }
3981
3986
  kw = kw[key];
3982
3987
  }
3983
3988
  }