title: Kotlin: checking result inside lambda
body: <p>I have lambda expression:</p>
  
  <pre><code>repository!!.getAllByDateForUser(userId, date)
                  .map { ... }
                  .flatMap { ... }
  </code></pre>
  
  <p>and so on. I need to check data after executing first row. For example, check that result list is not empty. And if it's empty, return other object or throw exception. If it is not empty, I run expression further. But I want to check it within expression.</p>
  
  <p>Please, advice, how to do it.</p>