title: Kotlin null pointer exception when inlined but not when separated
body: <p>When collapsing code down into a single line, a null pointer exception starts getting thrown. But if separated into multiple variables, then it works just fine. Noticed the issue when upgrading to kotlin 1.5.0 on android api 31.</p>
  <p>Code inline:</p>
  <pre><code>embeddedBasket?.basket?.items?.items?.asSequence()?.map { it.productItem }?.toMutableList() ?: mutableListOf() // throws null pointer exception
  </code></pre>
  <p>Code separated:</p>
  <pre><code>val productResponses = embeddedBasket?.basket?.items?.items // null
  val asSequence = productResponses?.asSequence() // null
  val map = asSequence?.map { it.productItem } // null
  val toMutableList = map?.toMutableList() // null
  val endList = toMutableList ?: mutableListOf() // Empty MutableList
  </code></pre>
  <p>Any idea why?</p>
  <p>Edit:</p>
  <p>Found the cause of the issue. It was Gson producing null values when converting from json elsewhere in the codebase. <a href="https://proandroiddev.com/safe-parsing-kotlin-data-classes-with-gson-4d560fe3cdd2" rel="nofollow noreferrer">Gson and Kotlin issue</a></p>