vert-x3 / vertx-web

HTTP web applications for Vert.x
Apache License 2.0
1.11k stars 535 forks source link

Add collection empty check before call "iterator().next()" #2588

Closed Xiqinger closed 8 months ago

Xiqinger commented 8 months ago

This can result in a NoSuchElementException if the collection is empty, leading to unexpected errors or exceptions.

vietj commented 8 months ago

does this happen ? I am not sure this is actually useful

Xiqinger commented 8 months ago

No. No runtime occurrence happened. This is just the result obtained from my manual analysis of the call graph. But after several manual analysis, I am still not sure if it is empty or not. If it is not empty, this pull request is useless. Thanks.

does this happen ? I am not sure this is actually useful

vietj commented 8 months ago

this isn't really useful for the test