mirror of https://github.com/vector-im/riot-web
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/10983pull/21833/head
parent
55e834f0ae
commit
e7fdc5002e
|
@ -67,7 +67,7 @@ module.exports = {
|
|||
* @return {string} the first letter
|
||||
*/
|
||||
getInitialLetter(name) {
|
||||
if (name.length < 1) {
|
||||
if (!name || name.length < 1) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue