You should check if there are any entries. Otherwise your intention fails with the exception on the following test case:

```kotlin
        for (() in listOf(1).withIndices()) {
        }
```