diff --git a/packages/nodes-base/nodes/Aws/AwsSnsTrigger.node.ts b/packages/nodes-base/nodes/Aws/AwsSnsTrigger.node.ts index 87b6e8239f..434499dd66 100644 --- a/packages/nodes-base/nodes/Aws/AwsSnsTrigger.node.ts +++ b/packages/nodes-base/nodes/Aws/AwsSnsTrigger.node.ts @@ -177,7 +177,7 @@ export class AwsSnsTrigger implements INodeType { data, 'ListSubscriptionsByTopicResponse.ListSubscriptionsByTopicResult.Subscriptions', ); - if (!subscriptions || !subscriptions.member) { + if (!subscriptions?.member) { return false; } diff --git a/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts b/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts index fbae15bb36..e3358a9432 100644 --- a/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts +++ b/packages/nodes-base/nodes/Google/Sheet/v2/helpers/GoogleSheet.ts @@ -124,7 +124,7 @@ export class GoogleSheet { const foundItem = response.sheets.find( (item: { properties: { sheetId: number } }) => item.properties.sheetId === +sheetId, ); - if (!foundItem || !foundItem.properties || !foundItem.properties.title) { + if (!foundItem?.properties?.title) { throw new Error(`Sheet with id ${sheetId} not found`); } return foundItem.properties.title;