mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/gamepad: bug fix: getGamepads might not be available under a non-secure context
Closes #2100
This commit is contained in:
parent
6fa39d5e73
commit
8d318fc4de
@ -47,6 +47,11 @@ func (g *nativeGamepads) update(gamepads *gamepads) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// getGamepads might not exist under a non-secure context (#2100).
|
||||
if !nav.Get("getGamepads").Truthy() {
|
||||
return nil
|
||||
}
|
||||
|
||||
gps := nav.Call("getGamepads")
|
||||
if !gps.Truthy() {
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user