Permalink
Browse files

Fixing null reference

  • Loading branch information...
1 parent 93147d4 commit 1cc35fb7846f55b9f256fa9f84c22aadee67a9eb Andre Rodrigues committed Oct 22, 2012
@@ -319,7 +319,9 @@ GithubClient.prototype._getRemoteUri = function GithubClient_prototype__getRemot
return __this._getRemote("azure", __cb(_, __frame, 5, 16, function ___(__0, __1) { originUri = __1; return (function __$GithubClient_prototype__getRemoteUri__15(__then) {
if (!originUri) {
return __this._getRemote("origin", __cb(_, __frame, 7, 18, function ___(__0, __2) { originUri = __2;
- originUri.origin = true; __then(); }, true)); } else { __then(); } ; })(function __$GithubClient_prototype__getRemoteUri__15() { _(null, null, true); }); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$GithubClient_prototype__getRemoteUri__15() {
+ if (originUri) {
+ originUri.origin = true; } ; __then(); }, true)); } else { __then(); } ; })(function __$GithubClient_prototype__getRemoteUri__15() { _(null, null, true); }); }, true)); }); })(function ___(__e, __r, __cont) { (function ___(__then) { __tryCatch(_, function __$GithubClient_prototype__getRemoteUri__15() {
+
progress.end(); __then(); }); })(function ___() { __tryCatch(_, function ___() { if (__cont) { __then(); } else { _(__e, __r); }; }); }); }); })(function ___() { __tryCatch(_, function __$GithubClient_prototype__getRemoteUri__15() {
@@ -328,7 +330,7 @@ GithubClient.prototype._getRemoteUri = function GithubClient_prototype__getRemot
return _(null, originUri); }); }); });};
-GithubClient.prototype._getRemote = function GithubClient_prototype__getRemote__16(name, _) { var remotes, origin, __this = this; var __frame = { name: "GithubClient_prototype__getRemote__16", line: 331 }; return __func(_, this, arguments, GithubClient_prototype__getRemote__16, 1, __frame, function __$GithubClient_prototype__getRemote__16() {
+GithubClient.prototype._getRemote = function GithubClient_prototype__getRemote__16(name, _) { var remotes, origin, __this = this; var __frame = { name: "GithubClient_prototype__getRemote__16", line: 333 }; return __func(_, this, arguments, GithubClient_prototype__getRemote__16, 1, __frame, function __$GithubClient_prototype__getRemote__16() {
return __this._exec("git remote -v", __cb(_, __frame, 1, 16, function ___(__0, __1) { remotes = __1;
origin = ((remotes.stdout + remotes.stderr)).split("\n").filter(function(item) {
return item.split(" ").some(function(it) {
@@ -319,7 +319,9 @@ GithubClient.prototype._getRemoteUri = function (_) {
originUri = this._getRemote('azure', _);
if (!originUri) {
originUri = this._getRemote('origin', _);
- originUri.origin = true;
+ if (originUri) {
+ originUri.origin = true;
+ }
}
} finally {
progress.end();
@@ -112,7 +112,7 @@ suite('cli', function(){
stderr: ''
};
- var cmd = 'node cli.js site create cliuttestsite --json --github --location'.split(' ');
+ var cmd = 'node cli.js site create cliuttestsite --github --json --location'.split(' ');
cmd.push('East US');
cmd.push('--username');
cmd.push(process.env['AZURE_GITHUB_USERNAME']);
@@ -122,6 +122,7 @@ suite('cli', function(){
capture(function() {
cli.parse(cmd);
}, function (result) {
+ console.log('terminei');
console.log(result);
done();
View
@@ -35,6 +35,8 @@ function capture(action, cb) {
return cb(result);
};
+ console.log('cheguei aqui');
+
try {
action();
} catch(err) {

0 comments on commit 1cc35fb

Please sign in to comment.