summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml2
-rw-r--r--lib/letter-avatars.js4
2 files changed, 5 insertions, 1 deletions
diff --git a/.travis.yml b/.travis.yml
index 2ce5723c..887299b0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -16,7 +16,7 @@ jobs:
- export PATH="$HOME/.yarn/bin:$PATH"
- env: task=npm-test
node_js:
- - 7
+ - 8
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "$YARN_VERSION"
- export PATH="$HOME/.yarn/bin:$PATH"
diff --git a/lib/letter-avatars.js b/lib/letter-avatars.js
index 53fa011a..55cf9c3a 100644
--- a/lib/letter-avatars.js
+++ b/lib/letter-avatars.js
@@ -27,6 +27,10 @@ exports.generateAvatar = function (name) {
exports.generateAvatarURL = function (name, email = '', big = true) {
let photo
+ if (typeof email !== 'string') {
+ email = '' + name + '@example.com'
+ }
+
if (email !== '' && config.allowGravatar) {
photo = 'https://www.gravatar.com/avatar/' + md5(email.toLowerCase())
if (big) {