Skip next exec if get empty json list

I have executions like this

`

.exec(http("${username} get all content")
.post("/all_content/${username}")
.check(status.is(200))
.check(jsonPath("$…result.item[*]").ofType[Map[String,Any]].findAll.saveAs(“allContent”)))
.feed(randomIntFeed)
.foreach("${allContent}", “content”) {
exec(http(“get content ${content.id}”)
.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 ${content.id}”).

What I should use?

Thanks!

So answer for me it's use optional

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