From a7751345be6eea794078fc9a139f0738902eeed4 Mon Sep 17 00:00:00 2001 From: chocolateboy Date: Tue, 3 Dec 2013 10:09:42 +0000 Subject: [PATCH] fix view.name for accounts without a "friendly" name --- js/githubresume.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/githubresume.js b/js/githubresume.js index 56a0f51..4b50237 100644 --- a/js/githubresume.js +++ b/js/githubresume.js @@ -142,8 +142,11 @@ var run = function() { addHttp = 'http://'; } + // set view.name to the "friendly" name e.g. "John Doe". If not defined + // (in which case data.name is empty), fall back to the login + // name e.g. "johndoe" var name = username; - if (data.name !== null && data.name !== undefined) { + if (data.name !== null && data.name !== undefined && data.name.length) { name = data.name; }