From 772af52f4ae37a8358ddb407c034890894e96986 Mon Sep 17 00:00:00 2001 From: Thomas Aylott Date: Thu, 31 Oct 2013 19:05:32 -0400 Subject: [PATCH] safer bind --- grunt/tasks/webdriver-jasmine.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grunt/tasks/webdriver-jasmine.js b/grunt/tasks/webdriver-jasmine.js index 68237ad906..125bfaf39f 100644 --- a/grunt/tasks/webdriver-jasmine.js +++ b/grunt/tasks/webdriver-jasmine.js @@ -18,7 +18,7 @@ module.exports = function(){ .get(this.data.url) .then(function(){return browser;}) .then(getJSReport) - .then(this.data.onComplete.bind(browser), this.data.onError.bind(browser)) + .then(this.data.onComplete && this.data.onComplete.bind(browser), this.data.onError && this.data.onError.bind(browser)) .fin(browser.quit.bind(browser)) .done(taskSucceeded.bind(null,true), taskSucceeded.bind(null,false)) ;