From 58635e8acf1dcf3e1a3ad82a0501f31520310d9e Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Thu, 27 Jun 2024 08:31:27 +0200 Subject: [PATCH] Make comparator work only on non-null objects --- .../swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt b/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt index f77a24aabc..25d556f471 100644 --- a/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +++ b/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt @@ -615,7 +615,7 @@ class GestureHandlerOrchestrator( private val matrixTransformCoords = FloatArray(2) private val inverseMatrix = Matrix() private val tempCoords = FloatArray(2) - private val handlersComparator = Comparator?> { a, b -> + private val handlersComparator = Comparator> { a, b -> return@Comparator if (a.isActive && b.isActive || a.isAwaiting && b.isAwaiting) { // both A and B are either active or awaiting activation, in which case we prefer one that // has activated (or turned into "awaiting" state) earlier