Skip to content

Commit

Permalink
fix: Do not try to save empty list of message
Browse files Browse the repository at this point in the history
  • Loading branch information
doubleface committed Oct 24, 2024
1 parent 81b30ae commit c4d820a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,13 @@ class AmeliContentScript extends SuperContentScript {
})

const messages = await this.fetchMessages()
await this.saveFiles(messages, {
context,
fileIdAttributes: ['vendorRef'],
contentType: 'application/pdf'
})
if (messages) {
await this.saveFiles(messages, {
context,
fileIdAttributes: ['vendorRef'],
contentType: 'application/pdf'
})
}

const identity = await this.fetchIdentity()
if (identity) {
Expand Down Expand Up @@ -303,7 +305,7 @@ class AmeliContentScript extends SuperContentScript {

if (await this.page.getByCss('.r_msg_aucun_message').isPresent()) {
this.launcher.log('info', 'No message to fetch')
return
return false
}

const docs = await this.page.evaluate(function parseMessages() {
Expand Down

0 comments on commit c4d820a

Please sign in to comment.