diff --git a/static/js/match_play.js b/static/js/match_play.js index e933c1879..8044ac63d 100644 --- a/static/js/match_play.js +++ b/static/js/match_play.js @@ -120,8 +120,10 @@ const setTestMatchName = function () { // Returns the integer team number entered into the team number input box for the given station, or 0 if it is empty. const getTeamNumber = function (station) { - const teamId = $(`#status${station} .team-number`).val().trim(); - return teamId ? parseInt(teamId) : 0; + const raw = $(`#status${station} .team-number`).val().trim(); + if (!raw) return 0; + const num = parseInt(raw); + return isNaN(num) ? 0 : num; } // Handles a websocket message to update the team connection status. diff --git a/templates/match_play.html b/templates/match_play.html index 0887f137c..5a6399ba3 100644 --- a/templates/match_play.html +++ b/templates/match_play.html @@ -242,6 +242,11 @@