Skip to content

Commit

Permalink
Accel null check !==
Browse files Browse the repository at this point in the history
  • Loading branch information
terryzfeng committed Oct 28, 2024
1 parent 9bbca36 commit 52afa5e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/accel/Accel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default class Accel {
private handleMotion(event: DeviceMotionEvent) {
this.accelActive();
if (this._accelActive) {
if (event.acceleration != null) {
if (event.acceleration !== null) {
this.theChuck.setFloat("_accelX", event.acceleration.x ? event.acceleration.x : 0.0);
this.theChuck.setFloat("_accelY", event.acceleration.y ? event.acceleration.y : 0.0);
this.theChuck.setFloat("_accelZ", event.acceleration.z ? event.acceleration.z : 0.0);
Expand Down

0 comments on commit 52afa5e

Please sign in to comment.