Problem with List View creating content dynamically

I'm trying to create a list view dynamically with an API call, but I found a problem when one or no elements are returned in the list as response of the API.

I can visualize it properly when there are more 2 or more elements, but it fails with 0 and 1.

I have also found the "Show empty list widget" option, but it still fails when the list is empty (with the same error), when I enable it.

Attached 2 screenshots, one with a list with two elements, and another with then error when there are less than 2 elements in the list.

Any help is appreciated, thank you all in advance!

4
13 replies