Skip to content

Commit af383c5

Browse files
committed
null-guard defaultAvatarUrlForString
Signed-off-by: Michael Telatynski <[email protected]>
1 parent 7fa1214 commit af383c5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Avatar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ function urlForColor(color) {
8282
const colorToDataURLCache = new Map();
8383

8484
export function defaultAvatarUrlForString(s) {
85+
if (!s) return "";
8586
const defaultColors = ['#0DBD8B', '#368bd6', '#ac3ba8'];
8687
let total = 0;
8788
for (let i = 0; i < s.length; ++i) {

0 commit comments

Comments
 (0)