summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGubolin <gubolin@fantasymail.de>2014-07-31 11:49:06 +0200
committerGubolin <gubolin@fantasymail.de>2014-07-31 11:49:06 +0200
commita3d195b69ecc1b2a35699606eed0ed42b0c8a729 (patch)
tree5f0532385939dcaaf0f0ad8c888ec6b931aa1a67
parent8362eac883a067e04633190ff98d060d7b627ca2 (diff)
downloadsnap-a3d195b69ecc1b2a35699606eed0ed42b0c8a729.tar.gz
snap-a3d195b69ecc1b2a35699606eed0ed42b0c8a729.zip
show error message when an unlogged user accesses the GitHub project list
-rw-r--r--github.js10
1 files changed, 8 insertions, 2 deletions
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 = [];