From 64ed562d057b21360a0c05d3d31e3fdf4e1b09a8 Mon Sep 17 00:00:00 2001 From: bartlomiej-korpus <0211711@gmail.com> Date: Thu, 26 May 2016 21:01:17 +0200 Subject: [PATCH] fix TypeError when authenticate is sent with null --- lib/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/index.js b/lib/index.js index 41d951b..fd9a39c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -41,7 +41,7 @@ function noQsMethod(options) { } }; - if(typeof data.token !== "string") { + if(!data || typeof data.token !== "string") { return onError({message: 'invalid token datatype'}, 'invalid_token'); }