Skip to content
Permalink
Browse files

util.get_card_image handles missing metadata

  • Loading branch information...
lusbenjamin committed Jul 29, 2019
1 parent 292c077 commit 9bc6287870b5c90e7a5ceb9ef2953a5efbfcf0fd
Showing with 7 additions and 6 deletions.
  1. +7 −6 shared/util.js
@@ -22,13 +22,14 @@ function get_card_image(cardObj) {
cardObj = db.card(cardObj);
}

if (!cardObj) {
return "../images/notfound.png";
} else {
return (
try {
let ret =
"https://img.scryfall.com/cards" +
cardObj.images[pd.settings.cards_quality]
);
cardObj.images[pd.settings.cards_quality];
return ret;
} catch (e) {
console.log("Cant find card art: ", cardObj);
return "../images/notfound.png";
}
}

0 comments on commit 9bc6287

Please sign in to comment.
You can’t perform that action at this time.