Closed amikko92 closed 4 years ago
oh !@#$
yes, make PR for it, but use if (this.vertexData2D || ...)
because I like null's too :)
Alright, will do!
PR is open. I altered your suggestion to if (!this.vertexData2D ||...
. I assume it is what you meant to type. Otherwise it won't evaluate to true for null
and undefined
.
https://github.com/pixijs/pixi-projection/pull/74
With the release of version 0.3.12, my issue has been solved. Thank you for such a quick response.
Occasionally I run into a crash bug when playing spine animations. The error log reads "Cannot read property 'length' of undefined" and points to line 65 in Mesh2d. The code there looks like this:
Checking in the debugger reveals that
vertexData2d
is indeed undefined.vertices
on the other hand is correctly populated with vertex data.What I find odd is how
vertexData2d
is supposed to be defined. The class initializes it tonull
and it's being assigned after the if-check that causes the crash. Unless it's assigned from somewhere outside. I haven't checked the entire code base.I tried modifying the crash site to check for
undefined
:Checking for
undefined
causes my animations to play as intended. However, I'm not 100 percent sure it doesn't produce some less obvious side effect.Would it be correct to check for
undefined
as described?