From 0bd7d2824c1d5a53c321bea90ee881d926cdc311 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Fri, 14 May 2021 17:04:20 +0200 Subject: [PATCH] add check for name in Avatar component --- packages/bbui/src/Avatar/Avatar.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/Avatar/Avatar.svelte b/packages/bbui/src/Avatar/Avatar.svelte index 7a6ad5f004..f4e42b28a3 100644 --- a/packages/bbui/src/Avatar/Avatar.svelte +++ b/packages/bbui/src/Avatar/Avatar.svelte @@ -16,7 +16,10 @@ function getInitials(name) { let parts = name.split(" ") - return parts.map(name => name[0]).join("") + if (parts.length > 0) { + return parts.map(name => name[0]).join("") + } + return name }