Skip to content

Commit

Permalink
Merge pull request #1888 from akto-api-security/hotfix/fix_empty_list…
Browse files Browse the repository at this point in the history
…_check

Adding empty list check for conditions
  • Loading branch information
notshivansh authored Jan 2, 2025
2 parents b969fe6 + 14e3e7b commit 96a9fc4
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public List<ApiCollection> fillApiCollectionsUrlCount(List<ApiCollection> 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()) {
Expand Down

0 comments on commit 96a9fc4

Please sign in to comment.