1
0
forked from extern/slate

silence errors when missing background images

This commit is contained in:
Gus Esquivel 2017-05-17 08:25:24 -05:00
parent 81989acb95
commit 86b73ea291
2 changed files with 4 additions and 4 deletions

View File

@ -264,8 +264,8 @@ renderTiles();
var getBackgroundImages = function() { var getBackgroundImages = function() {
var backgrounds = document.getElementsByTagName("body"); var backgrounds = document.getElementsByTagName("body");
var images = []; var images = [];
if (backgrounds.length > 0) { var imgString = backgrounds[0].getAttribute("data-backgrounds");
var imgString = backgrounds[0].getAttribute("data-backgrounds"); if (imgString) {
images = imgString.split(/[\s,]+/).filter(Boolean); images = imgString.split(/[\s,]+/).filter(Boolean);
} }
return images; return images;

View File

@ -3465,8 +3465,8 @@ renderTiles();
var getBackgroundImages = function() { var getBackgroundImages = function() {
var backgrounds = document.getElementsByTagName("body"); var backgrounds = document.getElementsByTagName("body");
var images = []; var images = [];
if (backgrounds.length > 0) { var imgString = backgrounds[0].getAttribute("data-backgrounds");
var imgString = backgrounds[0].getAttribute("data-backgrounds"); if (imgString) {
images = imgString.split(/[\s,]+/).filter(Boolean); images = imgString.split(/[\s,]+/).filter(Boolean);
} }
return images; return images;