Guard against falsy names in getInitialLetter
This ensures we check for a falsy name in `getInitialLetter` instead of throwing errors. We should perhaps also fix whatever other issues have led to the input being undefined in the first place, but for now we leave this for another day. Hopefully helps with https://github.com/vector-im/riot-web/issues/10983
This commit is contained in:
parent
55e834f0ae
commit
e7fdc5002e
1 changed files with 1 additions and 1 deletions
|
@ -67,7 +67,7 @@ module.exports = {
|
||||||
* @return {string} the first letter
|
* @return {string} the first letter
|
||||||
*/
|
*/
|
||||||
getInitialLetter(name) {
|
getInitialLetter(name) {
|
||||||
if (name.length < 1) {
|
if (!name || name.length < 1) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue