Skip to content

Commit

Permalink
Added null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
walidkayhan committed Jan 26, 2024
1 parent 5fe12a4 commit ce38239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/lib/gamepad/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ export const onGamepadButtonPress = ({ detail }) => {
return null;
}

const foundAction = currentProfile.buttons.find(({ value }) => value === button);
const foundAction = currentProfile.buttons?.find(({ value }) => value === button);

if (!detail.pressed && foundAction.primaryAction?.includes('JOG') || foundAction.secondaryAction?.includes('JOG')) {
if (!detail.pressed && foundAction?.primaryAction?.includes('JOG') || foundAction.secondaryAction?.includes('JOG')) {
return 'STOP_JOG';
}

Expand Down

0 comments on commit ce38239

Please sign in to comment.