mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05: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
1 changed files with 7 additions and 3 deletions
|
@ -30,8 +30,12 @@ export default Component.extend({
|
||||||
}),
|
}),
|
||||||
|
|
||||||
initials: computed('member.name', function () {
|
initials: computed('member.name', function () {
|
||||||
let names = this.member.name.split(' ');
|
let name = this.member.name;
|
||||||
|
if (name) {
|
||||||
|
let names = name.split(' ');
|
||||||
let intials = [names[0][0], names[names.length - 1][0]];
|
let intials = [names[0][0], names[names.length - 1][0]];
|
||||||
return intials.join('').toUpperCase();
|
return intials.join('').toUpperCase();
|
||||||
|
}
|
||||||
|
return '';
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue