mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-27 19:22:49 +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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// getGamepads might not exist under a non-secure context (#2100).
|
||||||
|
if !nav.Get("getGamepads").Truthy() {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
gps := nav.Call("getGamepads")
|
gps := nav.Call("getGamepads")
|
||||||
if !gps.Truthy() {
|
if !gps.Truthy() {
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user