Jelajahi Sumber

modified the null check

白石誠 5 tahun lalu
induk
melakukan
a83fc35eaa
1 mengubah file dengan 2 tambahan dan 4 penghapusan
  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 (