From f02c9f3d08fc129b026e1ab9c142aad3259d3992 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 21 Apr 2016 18:58:59 +0100 Subject: [PATCH] Add validation --- static/src/js/components/image-panel.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static/src/js/components/image-panel.js b/static/src/js/components/image-panel.js index 0efb895..53b42c8 100644 --- a/static/src/js/components/image-panel.js +++ b/static/src/js/components/image-panel.js @@ -1,6 +1,9 @@ export default function renderImagePanels() { $('.image-panel').each(function () { const element = $(this); + if (!element.data('image')) { // if it doesnt have an image, ignore it. + return; + } element.css('background-image', 'url("' + element.data('image') + '")');