From aff9f0d285bcf2ad3d90e264cb61d072a5a3c22e Mon Sep 17 00:00:00 2001 From: "dima.avdeev" <99798741+dima-avdeev-jb@users.noreply.github.com> Date: Tue, 7 Mar 2023 22:28:34 +0300 Subject: [PATCH] fix todoapp-lite iOS (#2844) --- .../kotlin/example/todoapp/lite/common/RootContent.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt b/experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt index dda40d34d2..be89e02ccf 100644 --- a/experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt +++ b/experimental/examples/todoapp-lite/shared/src/commonMain/kotlin/example/todoapp/lite/common/RootContent.kt @@ -34,5 +34,5 @@ internal fun RootContent(modifier: Modifier = Modifier) { private val RootState.editingItem: TodoItem? get() = editingItemId?.let(items::firstById) -private fun List.firstById(id: Long): TodoItem = - first { it.id == id } +private fun List.firstById(id: Long): TodoItem? = + firstOrNull { it.id == id }