Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Added guard against undefined member name (#1322)
Browse files Browse the repository at this point in the history
no-issue

This is causing issues since we removed the name property from member
objects. This change stops admin crashing out, but a more correct
handling of the missing name property should happen at a later point.
  • Loading branch information
allouis committed Sep 12, 2019
1 parent a8ea51b commit 5ec6d34
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/components/gh-member-avatar.js
Expand Up @@ -30,8 +30,12 @@ export default Component.extend({
}),

initials: computed('member.name', function () {
let names = this.member.name.split(' ');
let intials = [names[0][0], names[names.length - 1][0]];
return intials.join('').toUpperCase();
let name = this.member.name;
if (name) {
let names = name.split(' ');
let intials = [names[0][0], names[names.length - 1][0]];
return intials.join('').toUpperCase();
}
return '';
})
});

0 comments on commit 5ec6d34

Please sign in to comment.