RxJava map nullable object

25 Views Asked by At

Why for it code not showing error?

override fun getNotifications(): Single<List<NotificationItem>> {
        return selfEmployedApi.getNotifications(isRead = true, isArchived = false)
            .handleError()
            .map {
                it.items?.mapNotNull { item ->
                    item.convert()
                }
            }
    }

Returned result not nullable, but map operator doing for nullable collection. It seemed to me that the code should be underlined with a red line

0

There are 0 best solutions below