Skip to content

Commit

Permalink
added null check (#199)
Browse files Browse the repository at this point in the history
* added null check

* invalid err value

* ping
  • Loading branch information
joshmgrant committed Apr 1, 2020
1 parent f70a032 commit 75b4d9d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/launcher/launcher.ts
Expand Up @@ -46,6 +46,13 @@ export function SaucelabsLauncher(args,
pendingHeartBeat = setTimeout( (driver) => {
log.debug('Heartbeat to Sauce Labs (%s) - fetching title', browserName)

if (driver === undefined){
log.error('Heartbeat to %s failed: driver is null\n %s', browserName)

clearTimeout(pendingHeartBeat)
return this._done('failure')
}

driver.title()
.then(null, (err) => {
log.error('Heartbeat to %s failed\n %s', browserName, formatSauceError(err))
Expand Down

0 comments on commit 75b4d9d

Please sign in to comment.