From f6b7dc45acd690225b92ceed8dc688263cae8958 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?=
 <skjnldsv@protonmail.com>
Date: Thu, 16 May 2019 17:04:43 +0200
Subject: Fix avatar errors, and migrate settings menu to Actions
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
---
 src/components/ContactDetails/ContactDetailsAvatar.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/components/ContactDetails/ContactDetailsAvatar.vue')

diff --git a/src/components/ContactDetails/ContactDetailsAvatar.vue b/src/components/ContactDetails/ContactDetailsAvatar.vue
index fb54cd89..cbccfdc9 100644
--- a/src/components/ContactDetails/ContactDetailsAvatar.vue
+++ b/src/components/ContactDetails/ContactDetailsAvatar.vue
@@ -108,8 +108,8 @@ export default {
 	},
 	computed: {
 		photo() {
-			const type = this.contact.vCard.getFirstProperty('photo').type
-			if (!this.contact.photo.startsWith('data') && type === 'binary') {
+			const photo = this.contact.vCard.getFirstProperty('photo')
+			if (photo && !this.contact.photo.startsWith('data') && photo.type === 'binary') {
 				// split on coma in case of any leftover base64 data and retrieve last part
 				// usually we come to this part when the base64 image type is unknown
 				return `data:image;base64,${this.contact.photo.split(',').pop()}`
@@ -242,7 +242,7 @@ export default {
 		},
 
 		updateImgSize() {
-			if (this.contact.photo) {
+			if (this.contact.photo && this.$refs.img) {
 				this.updateHeightWidth(this.$refs.img.naturalHeight, this.$refs.img.naturalWidth)
 			}
 		},
-- 
cgit v1.2.3

