Skip to content

Commit

Permalink
Merge pull request #27 from jessejlt/master
Browse files Browse the repository at this point in the history
Fix potential crash in token handler
  • Loading branch information
SpeCT committed Jul 29, 2013
2 parents 1ea1ae0 + ed10205 commit e02192d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/c2dm.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ util.inherits(C2DM, emitter);
exports.C2DM = C2DM;

C2DM.prototype.captureToken = function(err, token) {
token = 'auth=' + token.replace(/Auth=/i,'');
this.token = token;
if (!err && token) {
token = 'auth=' + token.replace(/Auth=/i,'');
this.token = token;
}
};

C2DM.prototype.login = function(cb) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "c2dm",
"description": "An interface to the Android Cloud to Device Messaging (C2DM) service for Node.js",
"version": "1.2.1",
"version": "1.2.2",
"author": "Yury Proshchenko <[email protected]>",
"contributors": [
{ "name": "Yury Proshchenko", "email": "[email protected]" },
Expand Down

0 comments on commit e02192d

Please sign in to comment.