Tree serialize method with specific ID throws exception "Cannot read properties of undefined"

Hi Webix Team,
If I call serialize method with a specific id, than the method throw an exception:

treestore.js:166 Uncaught TypeError: Cannot read properties of undefined

My Code is:

const a = this.treeView.serialize(1670386856657);

Debugger:

The item with specific ID of tree does not contain child items, maybe thats the reason why the method throw an exception, because the method cannot return an json object.
But for my point of view, the method should return undefined or empty json Array, this kind of exception is very unsexy :smile: So is my evaluation correct or maybe the exception has a different reason? Thank you so much.

Hello @qeychon!

It seems like you trying serialize method for the item without child, while this method intended for the branch.

Please, try to use getItem() instead.