From 3a07af647c5f667b6f678c0140e0a07d225ae739 Mon Sep 17 00:00:00 2001 From: Jeff Clarke Date: Sun, 9 Oct 2022 10:17:02 -0400 Subject: [PATCH] Fixed logo bug with leagues not in local list --- MMM-MyScoreboard.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/MMM-MyScoreboard.js b/MMM-MyScoreboard.js index 6098c0a..1e5f89f 100644 --- a/MMM-MyScoreboard.js +++ b/MMM-MyScoreboard.js @@ -362,9 +362,9 @@ Module.register("MMM-MyScoreboard",{ var hTeamLogoImg = document.createElement("img"); - if (this.localLogos[leagueForLogoPath].indexOf(gameObj.hTeam + ".svg") !== -1) { + if (this.localLogos[leagueForLogoPath] && this.localLogos[leagueForLogoPath].indexOf(gameObj.hTeam + ".svg") !== -1) { hTeamLogoImg.src = this.file("logos/" + leagueForLogoPath + "/" + gameObj.hTeam + ".svg"); - } else if (this.localLogos[leagueForLogoPath].indexOf(gameObj.hTeam + ".png") !== -1) { + } else if (this.localLogos[leagueForLogoPath] && this.localLogos[leagueForLogoPath].indexOf(gameObj.hTeam + ".png") !== -1) { hTeamLogoImg.src = this.file("logos/" + leagueForLogoPath + "/" + gameObj.hTeam + ".png"); } else { hTeamLogoImg.src = gameObj.hTeamLogoUrl; @@ -389,9 +389,9 @@ Module.register("MMM-MyScoreboard",{ var vTeamLogoImg = document.createElement("img"); - if (this.localLogos[leagueForLogoPath].indexOf(gameObj.vTeam + ".svg") !== -1) { + if (this.localLogos[leagueForLogoPath] && this.localLogos[leagueForLogoPath].indexOf(gameObj.vTeam + ".svg") !== -1) { vTeamLogoImg.src = this.file("logos/" + leagueForLogoPath + "/" + gameObj.vTeam + ".svg"); - } else if (this.localLogos[leagueForLogoPath].indexOf(gameObj.vTeam + ".png") !== -1) { + } else if (this.localLogos[leagueForLogoPath] && this.localLogos[leagueForLogoPath].indexOf(gameObj.vTeam + ".png") !== -1) { vTeamLogoImg.src = this.file("logos/" + leagueForLogoPath + "/" + gameObj.vTeam + ".png"); } else { vTeamLogoImg.src = gameObj.vTeamLogoUrl;