diff --git a/painter.js b/painter.js index 5caa934..786cc84 100644 --- a/painter.js +++ b/painter.js @@ -66,7 +66,7 @@ Component({ action: { type: Object, observer: function (newVal, oldVal) { - if (newVal) { + if (newVal && !this.isEmpty(newVal)) { this.doAction(newVal, (callbackInfo) => { this.movingCache = callbackInfo }, false, true) @@ -268,7 +268,7 @@ Component({ } if (newVal && newVal.url && doView.url && newVal.url !== doView.url) { downloader.download(newVal.url, this.properties.LRU).then((path) => { - if (newVal.url.startsWidth('https')) { + if (newVal.url.startsWith('https')) { doView.originUrl = newVal.url } doView.url = path; @@ -283,8 +283,9 @@ Component({ this.reDraw(doView, callback, isMoving) } }) - }).catch(() => { + }).catch((error) => { // 未下载成功,直接绘制 + console.error(error) this.reDraw(doView, callback, isMoving) }) } else {