From 030bc6398a271d27b4389ff748f1a50537c8cb18 Mon Sep 17 00:00:00 2001 From: Drake Boley Date: Wed, 29 May 2024 12:48:46 -0700 Subject: [PATCH] Fix unsafe access of scope.block.id.name within FunctionDeclaration --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index a50975e..9c24ed5 100644 --- a/src/index.js +++ b/src/index.js @@ -68,6 +68,7 @@ const isReactFunctionComponent = (scope) => { switch (scope.block.type) { case "FunctionDeclaration": return ( + scope && scope.block && scope.block.id && isFirstLetterCapitalized(scope.block.id.name) && isReturnValueJSXOrNull(scope) );