Просмотр исходного кода

Prevent request if project id is undefined or falsy

jnfrati 4 лет назад
Родитель
Сommit
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>",