Skip to content

Commit

Permalink
Merge pull request #383 from Belchy06/gamepad
Browse files Browse the repository at this point in the history
Fix bad id checks
  • Loading branch information
mcottontensor authored Dec 20, 2024
2 parents ffeb52c + e2a556d commit 13ce022
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Frontend/library/src/Inputs/GamepadController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class GamepadController implements IInputController {
const deletedController = this.controllers[gamepad.index];
delete this.controllers[gamepad.index];
this.controllers = this.controllers.filter((controller) => controller !== undefined);
if (deletedController.id) {
if (deletedController.id !== undefined) {
this.streamMessageController.toStreamerHandlers.get('GamepadDisconnected')([
deletedController.id
]);
Expand Down Expand Up @@ -224,7 +224,7 @@ export class GamepadController implements IInputController {
// When a user navigates away from the page, we need to inform UE of all the disconnecting
// controllers
for (const controller of this.controllers) {
if (!controller || !controller.id) {
if (!controller || controller.id === undefined) {
continue;
}
this.streamMessageController.toStreamerHandlers.get('GamepadDisconnected')([controller.id]);
Expand Down

0 comments on commit 13ce022

Please sign in to comment.