79763210

Date: 2025-09-12 17:29:00
Score: 1
Natty:
Report link

firstOrNull() is a Kotlin extension function that works on kotlin.collections.Iterable<T>

but productDetailsList is a Java List<ProductDetails> (from the Play Billing library).

Convert to Kotlin collection first

val firstProduct: ProductDetails? = productDetailsList
    ?.toList()
    ?.firstOrNull()
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): is a
  • Low reputation (0.5):
Posted by: harsh bangari