From b458b2ae5f6c939781af16e32b50e61e1c1bf929 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Fri, 8 Feb 2019 12:07:25 -0500
Subject: [PATCH] Check if variable exists before using
---
src/components/image_cropper/image_cropper.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/components/image_cropper/image_cropper.js b/src/components/image_cropper/image_cropper.js
index c15ce9d8..d919827f 100644
--- a/src/components/image_cropper/image_cropper.js
+++ b/src/components/image_cropper/image_cropper.js
@@ -52,7 +52,9 @@ const ImageCropper = {
},
methods: {
destroy () {
- this.cropper.destroy()
+ if (this.cropper) {
+ this.cropper.destroy()
+ }
this.$refs.input.value = ''
this.dataUrl = undefined
},