Check if variable exists before using

This commit is contained in:
taehoon 2019-02-08 12:07:25 -05:00
parent ddfdaf3284
commit b458b2ae5f

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
}, },