diff --git a/lib/c2dm.js b/lib/c2dm.js index 4b277d3..3c48834 100644 --- a/lib/c2dm.js +++ b/lib/c2dm.js @@ -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) { diff --git a/package.json b/package.json index e3f8049..3283515 100644 --- a/package.json +++ b/package.json @@ -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 ", "contributors": [ { "name": "Yury Proshchenko", "email": "spect.man@gmail.com" },