Skip to content

Commit

Permalink
Fixed logo bug with leagues not in local list
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Clarke authored and Jeff Clarke committed Oct 9, 2022
1 parent fd462ed commit 3a07af6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions MMM-MyScoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 3a07af6

Please sign in to comment.