Browse Source

fixed undefined error

kaori 4 years ago
parent
commit
c56b3e9713
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/app/src/components/Me/EditorSettings.tsx

+ 2 - 2
packages/app/src/components/Me/EditorSettings.tsx

@@ -155,7 +155,7 @@ const RuleListGroup: FC<RuleListGroupProps> = ({
   const { t } = useTranslation();
   const { t } = useTranslation();
 
 
   const isCheckedRule = (ruleName: string) => (
   const isCheckedRule = (ruleName: string) => (
-    textlintRules.find(stateRule => (
+    textlintRules?.find(stateRule => (
       stateRule.name === ruleName
       stateRule.name === ruleName
     ))?.isEnabled || false
     ))?.isEnabled || false
   );
   );
@@ -201,7 +201,7 @@ const RuleListGroup: FC<RuleListGroupProps> = ({
 RuleListGroup.propTypes = {
 RuleListGroup.propTypes = {
   title: PropTypes.string.isRequired,
   title: PropTypes.string.isRequired,
   ruleList: PropTypes.array.isRequired,
   ruleList: PropTypes.array.isRequired,
-  textlintRules: PropTypes.array.isRequired,
+  textlintRules: PropTypes.array,
   setTextlintRules: PropTypes.func.isRequired,
   setTextlintRules: PropTypes.func.isRequired,
 };
 };