aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Admiraal <wouter.admiraal@sonarsource.com>2023-08-18 12:20:46 +0200
committersonartech <sonartech@sonarsource.com>2023-08-22 20:03:05 +0000
commit8e85496afd806079b9125f351cf5574f65ff8147 (patch)
treec96218e0e1470bf574e621bc932cc40e599af9a5
parent522fa260117430bc04d259f74dba57a1deb3f14b (diff)
downloadsonarqube-8e85496afd806079b9125f351cf5574f65ff8147.tar.gz
sonarqube-8e85496afd806079b9125f351cf5574f65ff8147.zip
[NO JIRA] Fix Code Smells
-rw-r--r--server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx4
1 files 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<Props> {
return null;
}
- const canCopy = selectedProfile.actions && selectedProfile.actions.copy;
+ const canCopy = selectedProfile.actions?.copy;
if (selectedProfile.isBuiltIn && canCopy) {
return (
<td className="coding-rule-table-meta-cell coding-rule-activation-actions">
@@ -147,7 +147,7 @@ export default class RuleListItem extends React.PureComponent<Props> {
);
}
- const canEdit = selectedProfile.actions && selectedProfile.actions.edit;
+ const canEdit = selectedProfile.actions?.edit;
if (!canEdit) {
return null;
}