From b524870200d56901482af5d6b18993ae1f6af6ec Mon Sep 17 00:00:00 2001 From: ntekka Date: Fri, 3 Sep 2021 14:50:49 -0700 Subject: [PATCH] fix: 'filter' of undefined when removing layers (#8057) --- .../src/provider-utils/awscloudformation/utils/layerHelpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts index bd4b27f2259..e4b37d668fd 100644 --- a/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts +++ b/packages/amplify-category-function/src/provider-utils/awscloudformation/utils/layerHelpers.ts @@ -245,7 +245,7 @@ export function getLambdaFunctionsDependentOnLayerFromMeta(layerName: string, me return Object.entries(meta[categoryName]).filter( ([_, lambdaFunction]: [string, $TSObject]) => lambdaFunction.service === ServiceName.LambdaFunction && - lambdaFunction?.dependsOn.filter(dependency => dependency.resourceName === layerName).length > 0, + lambdaFunction?.dependsOn?.filter(dependency => dependency.resourceName === layerName).length > 0, ); }