mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
fix(Gmail Trigger Node): Early returns in case of no data (#6727)
This commit is contained in:
parent
1f70f49ce5
commit
c2511a829c
|
@ -257,8 +257,9 @@ export class GmailTrigger implements INodeType {
|
|||
);
|
||||
responseData = responseData.messages;
|
||||
|
||||
if (responseData === undefined) {
|
||||
responseData = [];
|
||||
if (!responseData?.length) {
|
||||
webhookData.lastTimeChecked = endDate;
|
||||
return null;
|
||||
}
|
||||
|
||||
const simple = this.getNodeParameter('simple') as boolean;
|
||||
|
@ -312,6 +313,11 @@ export class GmailTrigger implements INodeType {
|
|||
);
|
||||
}
|
||||
|
||||
if (!responseData?.length) {
|
||||
webhookData.lastTimeChecked = endDate;
|
||||
return null;
|
||||
}
|
||||
|
||||
const getEmailDateAsSeconds = (email: IDataObject) => {
|
||||
const { internalDate, date } = email;
|
||||
return internalDate
|
||||
|
|
Loading…
Reference in a new issue