fix: use root context if buildAvatar context is undefined

This commit is contained in:
Julian Lam
2021-02-17 12:51:04 -05:00
parent ed3d9dcbbf
commit b4c0b32b26

View File

@@ -284,6 +284,11 @@
* component: overrides the default component (optional, default none)
*/
// Try to use root context if passed-in userObj is undefined
if (!userObj) {
userObj = this;
}
var attributes = [
'alt="' + userObj.username + '"',
'title="' + userObj.username + '"',