Explorar el Código

Prevent request if project id is undefined or falsy

jnfrati hace 4 años
padre
commit
69be065e3c
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  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) {
   async checkIfProjectHasBilling(projectId: number) {
+    if (!projectId) {
+      return false;
+    }
     try {
     try {
       const res = await api.getHasBilling(
       const res = await api.getHasBilling(
         "<token>",
         "<token>",