Permalink
Browse files

Merge pull request bnoguchi#261 from philippkueng/patch-1

fix for issue bnoguchi#244 where the tumblr module is returning an undefined user when there are multiple tumblelogs associated to the account.
  • Loading branch information...
bnoguchi committed Aug 8, 2012
2 parents bf495f7 + 491f836 commit 14092410e6007a1436079694998569cfa9428af0
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/modules/tumblr.js
View
@@ -14,7 +14,12 @@ oauthModule.submodule('tumblr')
if (err) return promise.fail(err);
var parser = new Parser();
parser.on('end', function (result) {
var oauthUser = result.tumblelog['@'];
var oauthUser;
if(result.tumblelog instanceof Array){
oauthUser = result.tumblelog[0]['@'];
} else {
oauthUser = result.tumblelog['@'];
}
promise.fulfill(oauthUser);
});
parser.parseString(data);

0 comments on commit 1409241

Please sign in to comment.