Skip to content

Commit 0ca1341

Browse files
authored
fix(useGamepad): handle case where hapticActuators is not present (#4068)
1 parent 7d4635a commit 0ca1341

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/useGamepad/components/Gamepad.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Controller from './Controller.vue'
55
66
const props = defineProps<{ gamepad: Gamepad }>()
77
8-
const supportsVibration = computed(() => props.gamepad.hapticActuators.length > 0)
8+
const supportsVibration = computed(() => props.gamepad?.hapticActuators?.length > 0)
99
function vibrate() {
1010
if (supportsVibration.value) {
1111
const actuator: any = props.gamepad.hapticActuators[0]

0 commit comments

Comments
 (0)