Check if variable exists before using

This commit is contained in:
taehoon 2019-02-08 12:07:25 -05:00
parent ddfdaf3284
commit b458b2ae5f
1 changed files with 3 additions and 1 deletions

View File

@ -52,7 +52,9 @@ const ImageCropper = {
}, },
methods: { methods: {
destroy () { destroy () {
this.cropper.destroy() if (this.cropper) {
this.cropper.destroy()
}
this.$refs.input.value = '' this.$refs.input.value = ''
this.dataUrl = undefined this.dataUrl = undefined
}, },