Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load on demands empty children cause exception #858

Closed
ivan-kolesov opened this issue Nov 11, 2024 · 12 comments · Fixed by #859
Closed

Load on demands empty children cause exception #858

ivan-kolesov opened this issue Nov 11, 2024 · 12 comments · Fixed by #859

Comments

@ivan-kolesov
Copy link

version 1.8.7

I am using on-demand loading with dataUrl option as a function.
The server generates a response, and in a certain case the server may return an empty array of children.
This causes an exception (in the source code) when in

this.doLoadDataFromUrl(null, node, () => {
  this.openNodeInternal(node, slide, onFinished);
});

openNodeInternal is called.

image

In this state node.children has an empty array.
Is it possible to avoid trying to open a node when there are no children?

@mbraak
Copy link
Owner

mbraak commented Nov 11, 2024

I'll have a look.

@mbraak
Copy link
Owner

mbraak commented Nov 11, 2024

The call stack in the screenshot starts with open. Does the error occur when calling open?

@ivan-kolesov
Copy link
Author

The call stack in the screenshot starts with open. Does the error occur when calling open?

This is the full stack.
2024-11-11 at 14 57

@mbraak
Copy link
Owner

mbraak commented Nov 11, 2024

I cannot reproduce the error. When does the error occur? When the tree is initialized?

@ivan-kolesov
Copy link
Author

I cannot reproduce the error. When does the error occur? When the tree is initialized?

When I open on demand a child.

@mbraak
Copy link
Owner

mbraak commented Nov 11, 2024

Ah, ok. I wasn't able to reproduce the error that way.

Is there something different in your code that might trigger the error? Maybe an option?

@ivan-kolesov
Copy link
Author

Is there something different in your code that might trigger the error? Maybe an option?

Will try to make a sandbox

@ivan-kolesov
Copy link
Author

Made a sandbox: https://codepen.io/ivan-kolesov/pen/poMqmVb
when try open Theropods error occurs. It seems that attribute children with empty value is the reason. Without children all correct.

@mbraak
Copy link
Owner

mbraak commented Nov 12, 2024

Thanks. I will have a look.

@mbraak
Copy link
Owner

mbraak commented Nov 13, 2024

Work in progress: #859

@mbraak
Copy link
Owner

mbraak commented Nov 13, 2024

The pr is merged. I plan to release a new version this week.

@mbraak
Copy link
Owner

mbraak commented Nov 17, 2024

The fix is in version 1.8.8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants