mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -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;
|
responseData = responseData.messages;
|
||||||
|
|
||||||
if (responseData === undefined) {
|
if (!responseData?.length) {
|
||||||
responseData = [];
|
webhookData.lastTimeChecked = endDate;
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const simple = this.getNodeParameter('simple') as boolean;
|
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 getEmailDateAsSeconds = (email: IDataObject) => {
|
||||||
const { internalDate, date } = email;
|
const { internalDate, date } = email;
|
||||||
return internalDate
|
return internalDate
|
||||||
|
|
Loading…
Reference in a new issue