Skip to content

Commit

Permalink
minor code tweaks, phetsims/aqua#150
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Nov 1, 2022
1 parent fec2275 commit 0ac7ccf
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions js/common/puppeteerLoad.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,22 +77,16 @@ module.exports = async function( url, options ) {
timeout: options.puppeteerTimeout
} );
const result = await promise;
await page.close();
!page.isClosed() && await page.close();

// If we created a temporary browser, close it
if ( ownsBrowser ) {
await browser.close();
}
ownsBrowser && await browser.close();
return result;
}

catch( e ) {
page && !page.isClosed() && await page.close();

// If we created a temporary browser, close it
if ( ownsBrowser ) {
await browser.close();
}
ownsBrowser && await browser.close();
return e;
}
};

0 comments on commit 0ac7ccf

Please sign in to comment.