From bdb7d580a6e977433c097bb281d42be5ed765389 Mon Sep 17 00:00:00 2001 From: Lexxie9952 <32187224+Lexxie9952@users.noreply.github.com> Date: Tue, 2 Apr 2024 15:10:57 -0700 Subject: [PATCH] Fix bug when checking for metaKey if there is no event object. --- freeciv-web/src/main/webapp/javascript/utility.js | 1 + 1 file changed, 1 insertion(+) diff --git a/freeciv-web/src/main/webapp/javascript/utility.js b/freeciv-web/src/main/webapp/javascript/utility.js index 1ce71ca82..0f2a48fbe 100644 --- a/freeciv-web/src/main/webapp/javascript/utility.js +++ b/freeciv-web/src/main/webapp/javascript/utility.js @@ -72,6 +72,7 @@ function FC_WRAP(value, range) during an event click. **************************************************************************/ const metaKey = (ev) => { + if (!ev) return false; return (reconfig_metakey ? (!ev.ctrlKey && ev.shiftKey && ev.altKey) : ev.metaKey); }