mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
Merge pull request #5270 from matrix-org/t3chguy/rs/3620
null-guard defaultAvatarUrlForString
This commit is contained in:
commit
4f52afdb3c
@ -82,6 +82,7 @@ function urlForColor(color) {
|
||||
const colorToDataURLCache = new Map();
|
||||
|
||||
export function defaultAvatarUrlForString(s) {
|
||||
if (!s) return ""; // XXX: should never happen but empirically does by evidence of a rageshake
|
||||
const defaultColors = ['#0DBD8B', '#368bd6', '#ac3ba8'];
|
||||
let total = 0;
|
||||
for (let i = 0; i < s.length; ++i) {
|
||||
|
Loading…
Reference in New Issue
Block a user