Преглед изворни кода

Prevent request if project id is undefined or falsy

jnfrati пре 4 година
родитељ
комит
69be065e3c
1 измењених фајлова са 3 додато и 0 уклоњено
  1. 3 0
      dashboard/src/main/home/Home.tsx

+ 3 - 0
dashboard/src/main/home/Home.tsx

@@ -294,6 +294,9 @@ class Home extends Component<PropsType, StateType> {
   }
 
   async checkIfProjectHasBilling(projectId: number) {
+    if (!projectId) {
+      return false;
+    }
     try {
       const res = await api.getHasBilling(
         "<token>",