diff --git a/lib/index.js b/lib/index.js index 620c25c..7d71c7c 100644 --- a/lib/index.js +++ b/lib/index.js @@ -32,7 +32,7 @@ var yellowLabTools = function(url, options) { .then(function(data) { // If a screenshot saveFunction was provided in the options - if (typeof options.saveScreenshotFn === 'function') { + if (options && typeof options.saveScreenshotFn === 'function') { debug('Now optimizing screenshot...'); // Remove uneeded temp screenshot path