Skip to content

Commit

Permalink
always check if browser and page are opened
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed Feb 13, 2024
1 parent 35cbb5b commit ab6d316
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions services/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ require('mathjs')
async function getScreenshot() {
let bufferImage
try {
await browserApi.getPage()
await this.startAndWarmUpBrowserIfNeeded()
} catch (error) {
console.log(error)
await this.startAndWarmUpBrowserIfNeeded()
return null
}
const name = Math.random().toString(36).substring(2,8)
Expand Down

0 comments on commit ab6d316

Please sign in to comment.