Handle empty list of gamepads

This commit is contained in:
Robert George 2022-01-18 19:54:18 -08:00
parent 6d6cb79e51
commit d4e8ddac67

View File

@ -478,7 +478,7 @@ async function rendermenu(datas) {
let gpUpdate;
function gameLoop() {
let gamePads = navigator.getGamepads();
if (!gamePads) return;
if (!gamePads?.[0]) return;
let gp = gamePads[0];
if (window.location.hash != "#game") {
gameStarted = false;