Skip to content

Commit d0930bc

Browse files
committed
Keyboard.addCallbacks didn't check to see if the arguments were null, only if they were undefined making the jsdocs misleading.
1 parent 832034a commit d0930bc

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,7 @@ can be controlled per-input mode.
307307
* Under setTimeOut (or when `forceSetTimeOut` was true) the Time was incorrectly setting `Time.timeExpected` causing game updates to lag (thanks @satan6 #2087)
308308
* Fixes edge case when TilingSprite is removed before render (thanks @pnstickne #2097 #2092)
309309
* Camera.setBoundsToWorld only adjusts the bounds if it exists (thanks @prudolfs #2099)
310+
* Keyboard.addCallbacks didn't check to see if the arguments were `null`, only if they were `undefined` making the jsdocs misleading.
310311

311312
### Pixi Updates
312313

src/input/Keyboard.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,17 @@ Phaser.Keyboard.prototype = {
120120

121121
this.callbackContext = context;
122122

123-
if (typeof onDown !== 'undefined')
123+
if (onDown !== undefined && onDown !== null)
124124
{
125125
this.onDownCallback = onDown;
126126
}
127127

128-
if (typeof onUp !== 'undefined')
128+
if (onUp !== undefined && onUp !== null)
129129
{
130130
this.onUpCallback = onUp;
131131
}
132132

133-
if (typeof onPress !== 'undefined')
133+
if (onPress !== undefined && onPress !== null)
134134
{
135135
this.onPressCallback = onPress;
136136
}

0 commit comments

Comments
 (0)