piqnt / planck.js

2D JavaScript Physics Engine
http://piqnt.com/planck.js/
MIT License
4.9k stars 236 forks source link

Don't dereference null pointer if elements don't exist #277

Closed jes closed 5 months ago

jes commented 5 months ago

StageTestbed.ts tried to use playButton, statusElement, and infoElement without checking whether they existed. This change fixes that.

Fixes #276

shakiba commented 5 months ago

Looks good, thanks for the fix!

jes commented 5 months ago

Thanks, btw where is the documentation source? I could submit a PR that would fix that up to add the testbed elements. I also noticed a few errors in the example in https://piqnt.com/planck.js/docs/rendering that I would like to fix.

shakiba commented 5 months ago

@jes Thanks for making updates! I added used manula docs to /docs folder in this repo.