Skip next exec if get empty json list

I have executions like this


.exec(http("${username} get all content")
.foreach("${allContent}", “content”) {
exec(http(“get content ${}”)
.post("/apu") …


On this step .check(jsonPath("$…result.item[*]").ofType[Map[String,Any]].findAll.saveAs(“allContent”))) I can get error - “nothing found” and if nothing found I want skipe next exec(http(“get content ${}”).

What I should use?


So answer for me it's use optional

Absolutely, and then wrap the next exec with a doIf where the test the list existence.