From 5f2cb671e2d27361b0e1561035fe1265d4061e6b Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Tue, 17 May 2022 10:35:14 +0100 Subject: [PATCH] making comparator override non null as kotlin guards against this --- .../ftueauth/MatrixOrgRegistrationStagesComparator.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/MatrixOrgRegistrationStagesComparator.kt b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/MatrixOrgRegistrationStagesComparator.kt index fcc70803a0..527c20987a 100644 --- a/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/MatrixOrgRegistrationStagesComparator.kt +++ b/vector/src/main/java/im/vector/app/features/onboarding/ftueauth/MatrixOrgRegistrationStagesComparator.kt @@ -20,8 +20,8 @@ import org.matrix.android.sdk.api.auth.registration.Stage class MatrixOrgRegistrationStagesComparator : Comparator { - override fun compare(a: Stage?, b: Stage?): Int { - return (a?.toPriority() ?: 0).compareTo(b?.toPriority() ?: 0) + override fun compare(a: Stage, b: Stage): Int { + return a.toPriority().compareTo(b.toPriority()) } private fun Stage.toPriority() = when (this) {