diff --git a/src/js/HuesEditor.js b/src/js/HuesEditor.js index 45c6803..3c62699 100644 --- a/src/js/HuesEditor.js +++ b/src/js/HuesEditor.js @@ -126,6 +126,9 @@ HuesEditor.prototype.initUI = function() { }; HuesEditor.prototype.resize = function(noHilightCalc) { + // If we were never instantiated but called externally + if(!this.root) + return; this.root.style.height = (window.innerHeight - 200) + "px"; let boxHeight = this.editArea.offsetHeight; let bHeadHeight = this.buildEdit._header.offsetHeight; diff --git a/src/js/ResourcePack.js b/src/js/ResourcePack.js index a13607d..c939a2b 100644 --- a/src/js/ResourcePack.js +++ b/src/js/ResourcePack.js @@ -299,7 +299,7 @@ Respack.prototype.parseImage = function(file) { this.images.push(img); } else { let existing = this.getImage(name); - debug("WARNING: Image", name, "already exists! Conflict with", file.name, "and", existing.name); + console.log("WARNING: Image", name, "already exists! Conflict with", file.name, "and", existing.name); return; } @@ -338,6 +338,9 @@ Respack.prototype.parseImageQueue = function() { // Maintain order return imagePromise; }).then(response => { + // Don't crash if the respack had duplicate images + if(!response) + return; let newImg = new Image(); newImg.src = response.bitmap; if (response.img.animated) {