From 6aed008c76cfe7cbca3efecc9779d69caaa902b1 Mon Sep 17 00:00:00 2001 From: le1tuan Date: Thu, 28 Sep 2017 15:43:16 +0700 Subject: [PATCH] init branch --- lib/twitter.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/twitter.js b/lib/twitter.js index 1dbf3e27..b5ed201d 100644 --- a/lib/twitter.js +++ b/lib/twitter.js @@ -116,11 +116,12 @@ Twitter.prototype.__request = function(method, path, params, callback) { } // Set API base - if (typeof params.base !== 'undefined') { - base = params.base; - delete params.base; + if (params) { + if (typeof params.base !== 'undefined') { + base = params.base; + delete params.base; + } } - // Build the options to pass to our custom request object var options = { method: method.toLowerCase(), // Request method - get || post