diff --git a/frontend/src/views/background/BackgroundItem.vue b/frontend/src/views/background/BackgroundItem.vue index c4a0250398..8acecde821 100644 --- a/frontend/src/views/background/BackgroundItem.vue +++ b/frontend/src/views/background/BackgroundItem.vue @@ -29,7 +29,7 @@ export default { }, computed: { itemActive() { - return this.curComponent.commonBackground && this.curComponent.commonBackground.innerImage === this.template.url + return this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.innerImage === this.template.url }, classBackground() { if (this.template.url) { diff --git a/frontend/src/views/background/index.vue b/frontend/src/views/background/index.vue index fc5eaa7d0d..b4643e8a7f 100644 --- a/frontend/src/views/background/index.vue +++ b/frontend/src/views/background/index.vue @@ -102,7 +102,7 @@ export default { } }, mounted() { - if (this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') { + if (this.curComponent && this.curComponent.commonBackground && this.curComponent.commonBackground.outerImage && typeof (this.curComponent.commonBackground.outerImage) === 'string') { this.fileList.push({ url: this.curComponent.commonBackground.outerImage }) } this.backgroundOrigin = deepCopy(this.curComponent.commonBackground)