Quantcast
Channel: Bugs Latest Topics
Viewing all articles
Browse latest Browse all 760

removeShadowCaster null exception

$
0
0

Hi,

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()) {
      this.removeShadowCaster(<any>child);
   }
}

So one version is to make check before:

var children = mesh.getChildren();
if (includeDescendants && children) {
   for (var child of children) {
      this.removeShadowCaster(<any>child);
   }
}

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


Viewing all articles
Browse latest Browse all 760

Trending Articles