Hersir Posted September 17, 2018 Share Posted September 17, 2018 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 Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 17, 2018 Author Share Posted September 17, 2018 this is introduced in beta 6 version, also if mesh.getChildren() can return undefined from now would be nice to show that in the return type Quote Link to comment Share on other sites More sharing options...
Guest Posted September 17, 2018 Share Posted September 17, 2018 I will fix that! Hersir 1 Quote Link to comment Share on other sites More sharing options...
Hersir Posted September 19, 2018 Author Share Posted September 19, 2018 @Deltakosh thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.