bengott/meteor-avatar

Error if defaultUrl not specified

Closed this issue · 5 comments

If the defaultAvatarUrl option is not specified, trying to call indexOf in the getUrl function will throw an exception. Also, I noticed that the default.png file that ships with the package is never used anywhere. You could potentially solve the indexOf error by using the path to default.png as a fallback for default url being undefined, but that raises the issue of whether you would prefer to show default.png or the user initials. Since the packaged default.png is in most cases going to be successfully loaded, using it as the fallback results in the initials being almost never shown.

Furthermore, I can't seem to get the initials to show at all. I tried providing no email hash and no default image, but the initials still didn't show up. The avatar just showed an image tag with no src, and the initials were hidden.

Thanks for the bug report. I'll look into it and get back to you. The list of options did get more complicated with the addition of the initials avatar, so it's possible that something slipped through the cracks.

@yourcelf Sorry, I didn't see your PR before pushing my changes. I've got more changes coming, not sure how your PR will fit in yet.

@erasaur This takes care of the exception. I'm in the process of making more changes to address to rest of your concerns.

Cool, thanks. Would love to see the initials working, I tend to prefer them over gravatars.

@erasaur Give version 0.6.0 a whirl when you have time. Let me know what you think and/or if you run into any more problems. Closing this issue now..

Looks like I'm able to see initials now. I've proposed a few minor changes, see my pull request here.