Bläddra i källkod

Fix bug when the node module is called without any option

Gaël Métais 4 år sedan
förälder
incheckning
280b564ab3
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      lib/index.js

+ 1 - 1
lib/index.js

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