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

Foreach loop in body observer throws class cast exception in chrome #61

Closed
vegegoku opened this issue Jul 7, 2018 · 3 comments
Closed

Comments

@vegegoku
Copy link
Contributor

vegegoku commented Jul 7, 2018

iterate over a node list received from mutation observer with foreach

for (Node node : nodes) {
}

it throws class cast exception
and this happens when the node is not an element, but a text or comment node
in firefox it works without errors

the solution for this is to use normal loops and do Js.uncheckedCast() to node, then we check the type of the node if it is an element node.

hpehl added a commit that referenced this issue Jul 10, 2018
@hpehl
Copy link
Member

hpehl commented Jul 10, 2018

3519d78 should fix the issue. @vegegoku could you please test if that works for you?

@vegegoku
Copy link
Contributor Author

@hpehl this works now, thank you so much.

@hpehl
Copy link
Member

hpehl commented Jul 11, 2018

Fixed by 3519d78

@hpehl hpehl closed this as completed Jul 11, 2018
hpehl added a commit that referenced this issue Jul 11, 2018
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

No branches or pull requests

2 participants