mirror of
https://github.com/vector-im/element-web.git
synced 2025-10-14 08:51:37 +02:00
Merge pull request #3498 from matrix-org/jryans/undef-avatar
Guard against falsy names in getInitialLetter
This commit is contained in:
commit
bb9fc609bf
@ -67,6 +67,11 @@ module.exports = {
|
|||||||
* @return {string} the first letter
|
* @return {string} the first letter
|
||||||
*/
|
*/
|
||||||
getInitialLetter(name) {
|
getInitialLetter(name) {
|
||||||
|
if (!name) {
|
||||||
|
// XXX: We should find out what causes the name to sometimes be falsy.
|
||||||
|
console.trace("`name` argument to `getInitialLetter` not supplied");
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
if (name.length < 1) {
|
if (name.length < 1) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user