Skip to content

Commit 35c04d9

Browse files
kosmydelcursoragent
andcommitted
[Android] Skip native detector detach when the registry is missing
removeViewAt was throwing for the default moduleId of -1, which has no registry when the prop is omitted. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 3dd3d8c commit 35c04d9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

‎packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerDetectorView.kt‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,7 @@ class RNGestureHandlerDetectorView(context: Context) : ReactViewGroup(context) {
230230
}
231231

232232
private fun detachNativeGestureHandlers() {
233-
val registry = RNGestureHandlerModule.registries[moduleId]
234-
?: throw Exception("Tried to access a non-existent registry")
233+
val registry = RNGestureHandlerModule.registries[moduleId] ?: return
235234

236235
for (tag in nativeHandlers) {
237236
if (!attachedHandlers.contains(tag)) {

0 commit comments

Comments
 (0)