diff --git a/src/lib/group/List.svelte b/src/lib/group/List.svelte index 3f258340..6b51713a 100644 --- a/src/lib/group/List.svelte +++ b/src/lib/group/List.svelte @@ -18,7 +18,7 @@ export let list: Group[]; export let members: Member[]; - $: memberlist = members.map(function(member) { return {name: member.name, shortid: member.id, id: member.uuid, display_name: member.display_name}; }).sort((a, b) => a.name.localeCompare(b.name)); + $: memberlist = members && members.map(function(member) { return {name: member.name, shortid: member.id, id: member.uuid, display_name: member.display_name}; }).sort((a, b) => a.name.localeCompare(b.name)); let token = localStorage.getItem("pk-token"); let listLoading = true; diff --git a/src/lib/member/List.svelte b/src/lib/member/List.svelte index a02cfac0..567ee367 100644 --- a/src/lib/member/List.svelte +++ b/src/lib/member/List.svelte @@ -18,7 +18,7 @@ export let list: Member[] = []; export let groups: Group[] = []; - $: grouplist = groups.map(function(group) { return {name: group.name, shortid: group.id, id: group.uuid, members: group.members, display_name: group.display_name}; }).sort((a, b) => a.name.localeCompare(b.name)); + $: grouplist = groups && groups.map(function(group) { return {name: group.name, shortid: group.id, id: group.uuid, members: group.members, display_name: group.display_name}; }).sort((a, b) => a.name.localeCompare(b.name)); let token = localStorage.getItem("pk-token"); let listLoading = true;