diff options
-rw-r--r-- | src/components/ContactDetails/ContactDetailsAvatar.vue | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue index 05273434..8afa46d2 100644 --- a/src/components/ContactDetails/ContactDetailsAvatar.vue +++ b/src/components/ContactDetails/ContactDetailsAvatar.vue @@ -76,7 +76,7 @@ export default { processFile(event) { if (event.target.files) { let file = event.target.files[0] - if (file.size && file.size <= 1 * 1024 * 1024) { + if (file && file.size && file.size <= 1 * 1024 * 1024) { let reader = new FileReader() let self = this // check if photo property exists to decide whether to add/update it @@ -90,6 +90,8 @@ export default { reader.readAsDataURL(file) } else { OC.Notification.showTemporary(t('contacts', 'Image is too big (max 1MB).')) + // reset input + event.target.value = '' } } }, |