Skip to content

Commit

Permalink
fix: add await for browser.close()
Browse files Browse the repository at this point in the history
We weren't waiting for a browser close when there was an error.
  • Loading branch information
jniles committed May 25, 2020
1 parent b5b01c9 commit f86a67b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ async function render(html, options = {}) {
await page.close();
return pdf;
} catch (e) {
if (browser) { browser.close(); }
if (browser) { await browser.close(); }
launchNewBrowser();
return null;
}
Expand Down

0 comments on commit f86a67b

Please sign in to comment.