Fix:修复自定义节点方法返回null时报错的问题

This commit is contained in:
街角小林 2023-12-11 09:20:44 +08:00
parent 0107eb79c2
commit 2678e429aa

View File

@ -179,10 +179,12 @@ class Node {
let { isUseCustomNodeContent, customCreateNodeContent } = this.mindMap.opt
if (isUseCustomNodeContent && customCreateNodeContent) {
this._customNodeContent = customCreateNodeContent(this)
this._customNodeContent.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml')
}
// 如果没有返回内容,那么还是使用内置的节点内容
if (this._customNodeContent) return
if (this._customNodeContent) {
this._customNodeContent.setAttribute('xmlns', 'http://www.w3.org/1999/xhtml')
return
}
this._imgData = this.createImgNode()
this._iconData = this.createIconNode()
this._textData = this.createTextNode()