Sfoglia il codice sorgente

modified the null check

白石誠 5 anni fa
parent
commit
a83fc35eaa
1 ha cambiato i file con 2 aggiunte e 4 eliminazioni
  1. 2 4
      src/client/js/components/Page/NotFoundAlert.jsx

+ 2 - 4
src/client/js/components/Page/NotFoundAlert.jsx

@@ -4,12 +4,10 @@ import PropTypes from 'prop-types';
 const NotFoundAlert = (props) => {
 
   function clickHandler(viewType) {
-    if (props.onPageCreateClicked) {
-      props.onPageCreateClicked(viewType);
-    }
-    else {
+    if (props.onPageCreateClicked === null) {
       return null;
     }
+    props.onPageCreateClicked(viewType);
   }
 
   return (