Explorar o código

Prevent request if project id is undefined or falsy

jnfrati %!s(int64=4) %!d(string=hai) anos
pai
achega
69be065e3c
Modificáronse 1 ficheiros con 3 adicións e 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) {
+    if (!projectId) {
+      return false;
+    }
     try {
       const res = await api.getHasBilling(
         "<token>",