You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If you attempt to add a null element text, e.g: create().ele('test').txt(null).up().end() it will throw the error, which I believe is coming from here in BaseWriter.js:
for (var i = 0; i < node.data.length; i++) {
I think passing in null should just make it an empty element. In my case I'm creating an XML file based on data from another 3rd party API, so if I want to be sure this won't throw an error I would have to replace every .txt(valueName) with .txt(valueName|| '') which is rather inconvenient!
Version:
node.js: 12.18.4
xmlbuilder2 2.4.0
The text was updated successfully, but these errors were encountered:
Describe the bug
If you attempt to add a null element text, e.g:
create().ele('test').txt(null).up().end()
it will throw the error, which I believe is coming from here inBaseWriter.js
:I think passing in null should just make it an empty element. In my case I'm creating an XML file based on data from another 3rd party API, so if I want to be sure this won't throw an error I would have to replace every
.txt(valueName)
with.txt(valueName|| '')
which is rather inconvenient!Version:
The text was updated successfully, but these errors were encountered: