From 60df377d94dba3838cf020e0710843a730065f9e Mon Sep 17 00:00:00 2001 From: Ken Sternberg <133134217+kensternberg-authentik@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:27:25 -0700 Subject: [PATCH] web: don't fail when `name.text` is undefined (#261) The check here is that `node.name` can be undefined; we then know that the node is private. But `node.name.text` can be undefined, and that should also not throw an exception at this check. I've added a small check to ensure this won't throw. --- .../analyzer/src/features/analyse-phase/creators/handlers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/analyzer/src/features/analyse-phase/creators/handlers.js b/packages/analyzer/src/features/analyse-phase/creators/handlers.js index 52cc386..a684c61 100644 --- a/packages/analyzer/src/features/analyse-phase/creators/handlers.js +++ b/packages/analyzer/src/features/analyse-phase/creators/handlers.js @@ -34,7 +34,7 @@ export function handleModifiers(doc, node) { } }); - if (node.name?.text.startsWith('#')) { + if (node.name?.text?.startsWith('#')) { doc.privacy = 'private'; }