Cannot read properties of null (reading 'edgesOut')
时间: 2023-08-28 13:20:37 浏览: 226
根据给出的引用内容,报错"TypeError: Cannot read properties of null (reading 'edgesOut')"是因为在代码中使用了一个为null的对象。可能是由于后端生成的null对象的值导致的。为了解决这个问题,可以进行如下修改:在代码中添加判断条件,如果对象为null,则将对应的属性移除。这样可以避免报错。具体代码修改如下所示:
```javascript
if (isNull(edgesOut)) {
curdJsonVm = replace(curdJsonVm, "${edgesOut},", "");
log.info("model page info:{}", JSONUtil.toJsonPrettyStr(curdJsonVm));
return curdJsonVm;
}
curdJsonVm = replace(curdJsonVm, "${edgesOut}", JSONObject.toJSONString(edgesOut));
```
通过这样的修改,就可以避免报错"TypeError: Cannot read properties of null (reading 'edgesOut')"的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [解决TypeError: Cannot read properties of null (reading ‘xxx‘)的错误](https://blog.csdn.net/lvoelife/article/details/129489923)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文