From a3d195b69ecc1b2a35699606eed0ed42b0c8a729 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Thu, 31 Jul 2014 11:49:06 +0200 Subject: show error message when an unlogged user accesses the GitHub project list --- github.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'github.js') diff --git a/github.js b/github.js index a3b3223..84c8630 100644 --- a/github.js +++ b/github.js @@ -218,8 +218,14 @@ GitHubBackend.prototype.saveProject = function (ide, callBack, errorCall) { GitHubBackend.prototype.getProjectList = function (callBack, errorCall) { var myself = this; - if (myself.gh !== null) { - myself.gh.getUser().getRepos().then( + if (myself.gh !== null){ + var user = myself.gh.getUser(); + + if (user === null) { + errorCall.call(myself, localize('Please login'), 'GitHub'); + } + + user.getRepos().then( function (repos) { var snapProjects = []; -- cgit v1.3.1