From 90018cf487613129052dfa90e7e43a7fc10ec6e7 Mon Sep 17 00:00:00 2001 From: Qstick Date: Thu, 26 Oct 2017 23:28:36 -0400 Subject: [PATCH] Check Exist before Rendering Posters/Banners --- frontend/src/Artist/ArtistBanner.js | 8 +++++--- frontend/src/Artist/ArtistPoster.js | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/frontend/src/Artist/ArtistBanner.js b/frontend/src/Artist/ArtistBanner.js index 34de9b8d0..b79c5cc97 100644 --- a/frontend/src/Artist/ArtistBanner.js +++ b/frontend/src/Artist/ArtistBanner.js @@ -11,11 +11,13 @@ function findBanner(images) { function getBannerUrl(banner, size) { if (banner) { + if (banner.url.contains('lastWrite')) { // Remove protocol - let url = banner.url.replace(/^https?:/, ''); - url = url.replace('banner.jpg', `banner-${size}.jpg`); + let url = banner.url.replace(/^https?:/, ''); + url = url.replace('banner.jpg', `banner-${size}.jpg`); - return url; + return url; + } } } diff --git a/frontend/src/Artist/ArtistPoster.js b/frontend/src/Artist/ArtistPoster.js index b939119ed..84867681b 100644 --- a/frontend/src/Artist/ArtistPoster.js +++ b/frontend/src/Artist/ArtistPoster.js @@ -11,11 +11,13 @@ function findPoster(images) { function getPosterUrl(poster, size) { if (poster) { - // Remove protocol - let url = poster.url.replace(/^https?:/, ''); - url = url.replace('poster.jpg', `poster-${size}.jpg`); + if (poster.url.contains('lastWrite')) { + // Remove protocol + let url = poster.url.replace(/^https?:/, ''); + url = url.replace('poster.jpg', `poster-${size}.jpg`); - return url; + return url; + } } }