From 8e85496afd806079b9125f351cf5574f65ff8147 Mon Sep 17 00:00:00 2001 From: Wouter Admiraal Date: Fri, 18 Aug 2023 12:20:46 +0200 Subject: [PATCH] [NO JIRA] Fix Code Smells --- .../src/main/js/apps/coding-rules/components/RuleListItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx index 1d29eddbcb0..152976ad5cc 100644 --- a/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx +++ b/server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx @@ -134,7 +134,7 @@ export default class RuleListItem extends React.PureComponent { return null; } - const canCopy = selectedProfile.actions && selectedProfile.actions.copy; + const canCopy = selectedProfile.actions?.copy; if (selectedProfile.isBuiltIn && canCopy) { return ( @@ -147,7 +147,7 @@ export default class RuleListItem extends React.PureComponent { ); } - const canEdit = selectedProfile.actions && selectedProfile.actions.edit; + const canEdit = selectedProfile.actions?.edit; if (!canEdit) { return null; } -- 2.39.5