]> source.dussan.org Git - sonarqube.git/commitdiff
[NO JIRA] Fix Code Smells
authorWouter Admiraal <wouter.admiraal@sonarsource.com>
Fri, 18 Aug 2023 10:20:46 +0000 (12:20 +0200)
committersonartech <sonartech@sonarsource.com>
Tue, 22 Aug 2023 20:03:05 +0000 (20:03 +0000)
server/sonar-web/src/main/js/apps/coding-rules/components/RuleListItem.tsx

index 1d29eddbcb0459bc21067c0acbea07b3b6220144..152976ad5cc437dac18eb1d62f1c3b7f84c6138a 100644 (file)
@@ -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;
     }