From 14e3e7b7d2fe466185d171d5a3c6b4354d1a1e38 Mon Sep 17 00:00:00 2001 From: Ark2307 Date: Thu, 2 Jan 2025 11:45:31 +0530 Subject: [PATCH] Adding empty list check for conditions --- .../src/main/java/com/akto/action/ApiCollectionsAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/src/main/java/com/akto/action/ApiCollectionsAction.java b/apps/dashboard/src/main/java/com/akto/action/ApiCollectionsAction.java index fa537a6c41..1f5f071649 100644 --- a/apps/dashboard/src/main/java/com/akto/action/ApiCollectionsAction.java +++ b/apps/dashboard/src/main/java/com/akto/action/ApiCollectionsAction.java @@ -90,7 +90,7 @@ public List fillApiCollectionsUrlCount(List apiCol int conditionsCount = 0; if(!apiCollection.getAutomated()){ ApiCollection apiCollectionWithCond = ApiCollectionsDao.instance.findOne(Filters.eq(Constants.ID, apiCollection.getId()), Projections.include("conditions")); - if(apiCollectionWithCond.getConditions() != null && apiCollectionWithCond.getConditions().get(0) != null){ + if(apiCollectionWithCond.getConditions() != null && !apiCollectionWithCond.getConditions().isEmpty() && apiCollectionWithCond.getConditions().get(0) != null){ if(apiCollectionWithCond.getConditions().get(0).getType().equals(TestingEndpoints.Type.CUSTOM)){ CustomTestingEndpoints testingEndpoints = (CustomTestingEndpoints) apiCollectionWithCond.getConditions().get(0); if (testingEndpoints.getApisList() != null && !testingEndpoints.getApisList().isEmpty()) {