From c1e45deef78922f1321de8ca1d2b87a58e2bcaca Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Wed, 4 Jan 2023 10:05:03 +0100 Subject: [PATCH] optimise check of tryExecuteAndNotify --- src/Umbraco.Web.UI.Client/eslint-local-rules.cjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/eslint-local-rules.cjs b/src/Umbraco.Web.UI.Client/eslint-local-rules.cjs index 5ec1820eed..79508d0358 100644 --- a/src/Umbraco.Web.UI.Client/eslint-local-rules.cjs +++ b/src/Umbraco.Web.UI.Client/eslint-local-rules.cjs @@ -51,7 +51,7 @@ module.exports = { // If methods called on *Resource classes are not already wrapped with `await tryExecuteAndNotify()`, then we should suggest to wrap them. CallExpression: function (node) { if (node.callee.type === 'MemberExpression' && node.callee.object.type === 'Identifier' && node.callee.object.name.endsWith('Resource') && node.callee.property.type === 'Identifier' && node.callee.property.name !== 'constructor') { - const hasTryExecuteAndNotify = node.parent.callee.name === 'tryExecuteAndNotify'; + const hasTryExecuteAndNotify = node.parent && node.parent.callee && node.parent.callee.name === 'tryExecuteAndNotify'; if (!hasTryExecuteAndNotify) { context.report({ node,