Permalink
Browse files

fix for issue #244 where the tumblr module is returning an undefined …

…user when there are multiple tumblelogs associated to the account.
  • Loading branch information...
philippkueng committed May 11, 2012
1 parent ae47e87 commit 491f83631bc46c47ae1d14bf59b874e4495ab214
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 491f836

Please sign in to comment.