Jump to content

removeShadowCaster null exception


Recommended Posts


found case that can trigger null pointer for removeShadowCaster, (possibly addShadowCaster as well).

As includeDescendants is true by default it tries to remove shadow from children as well, but _children array can be null.

if (includeDescendants) {
   // mesh.getChildren() can be null 
   for (var child of mesh.getChildren()) {

So one version is to make check before:

var children = mesh.getChildren();
if (includeDescendants && children) {
   for (var child of children) {

Same issue is on addShadowCaster as it tries to push children in the list

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...