azerion / phaser-input

Adds input boxes to Phaser like CanvasInput, but also works for WebGL and Mobile, made for Phaser only.
MIT License
201 stars 64 forks source link

Fixed bug 'update of null' with this.placeholder #42

Closed CFix-Ollie closed 7 years ago

CFix-Ollie commented 7 years ago

update function was not checking that this.placeholder exists before attempting to call it's update function.

Tdnshah commented 7 years ago

I am using phaser input and got the error on Uncaught TypeError: Cannot read property 'update' of null ' with this.placeHolder and as on the issue #41 @CFix-Ollie suggested to add a check on this.placeHolder before its called by update and also he gave a commit for the phaser-input.ts file. I faced the same problem in javascript version and the same solution worked for me too hence I have committed same changes for phaser-input.js. Have sent a PR #45

i haven't committed any changes to phaser-input.min.js hence if any one using minified then it still needs to be updated.