mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
Added guard against undefined member name (#1322)
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.
This commit is contained in:
parent
d9b09f4c4f
commit
e6db09620e
@ -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 '';
|
||||
})
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user