From 8d148fcdee39a49b596ecbbe5be1b41c52020732 Mon Sep 17 00:00:00 2001 From: Gregory Moskaliuk Date: Sun, 26 Jul 2026 14:50:46 +0200 Subject: [PATCH] fix(ios): replace crash-causing RCTAssert with RCTLogWarn in touch handler --- .../react-native/React/Fabric/RCTSurfaceTouchHandler.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm index 4945d3559f60..1bf565db2266 100644 --- a/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm +++ b/packages/react-native/React/Fabric/RCTSurfaceTouchHandler.mm @@ -8,6 +8,7 @@ #import "RCTSurfaceTouchHandler.h" #import +#import #import #import @@ -206,8 +207,8 @@ - (void)_updateTouches:(NSSet *)touches { for (UITouch *touch in touches) { auto iterator = _activeTouches.find(touch); - RCTAssert(iterator != _activeTouches.end(), @"Inconsistency between local and UIKit touch registries"); if (iterator == _activeTouches.end()) { + RCTLogWarn(@"Inconsistency between local and UIKit touch registries"); continue; } @@ -219,8 +220,8 @@ - (void)_unregisterTouches:(NSSet *)touches { for (UITouch *touch in touches) { auto iterator = _activeTouches.find(touch); - RCTAssert(iterator != _activeTouches.end(), @"Inconsistency between local and UIKit touch registries"); if (iterator == _activeTouches.end()) { + RCTLogWarn(@"Inconsistency between local and UIKit touch registries"); continue; } auto &activeTouch = iterator->second; @@ -236,8 +237,8 @@ - (void)_unregisterTouches:(NSSet *)touches for (UITouch *touch in touches) { auto iterator = _activeTouches.find(touch); - RCTAssert(iterator != _activeTouches.end(), @"Inconsistency between local and UIKit touch registries"); if (iterator == _activeTouches.end()) { + RCTLogWarn(@"Inconsistency between local and UIKit touch registries"); continue; } activeTouches.push_back(iterator->second);