From 68faea7d86032694df3d390a7379089387a39013 Mon Sep 17 00:00:00 2001 From: Trivernis Date: Sat, 11 May 2019 14:32:29 +0200 Subject: [PATCH] Hotfix: Missing game urlparam in front-end - added default return value if the game param is not set to getGameParam on bingo --- public/javascripts/bingo-web.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/public/javascripts/bingo-web.js b/public/javascripts/bingo-web.js index c891bc1..c9ee9f6 100644 --- a/public/javascripts/bingo-web.js +++ b/public/javascripts/bingo-web.js @@ -3,7 +3,11 @@ * @returns {string} */ function getGameParam() { - return window.location.href.match(/\?game=(\w+)/)[1]; + let matches = window.location.href.match(/\?game=(\w+)/); + if (matches) + return matches[1]; + else + return ''; } /**