summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/sendgrid.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/sendgrid.js b/lib/sendgrid.js
index 2b1ae77..eb58f84 100644
--- a/lib/sendgrid.js
+++ b/lib/sendgrid.js
@@ -115,7 +115,12 @@ function SendGrid(apiKey, host, globalHeaders) {
}
//Try to use native promises by default
-SendGrid.Promise = Promise || null;
+if (typeof Promise !== 'undefined') {
+ SendGrid.Promise = Promise;
+}
+else {
+ SendGrid.Promise = null;
+}
//Export
module.exports = SendGrid;