Skip to content

Commit

Permalink
Replace assert calls with RCTAssert in RCTSurfaceTouchHandler
Browse files Browse the repository at this point in the history
Summary:
Changelog: [Internal] Replace assert calls with RCTAssert in RCTSurfaceTouchHandler

We've been recieving crash report tasks related to these calls but it appears (based on D19221204 (23d2a62)) that the expectation was that these should be stripped in production and don't cause real problems. RCTAssert does not have that same issue.

Reviewed By: fkgozali

Differential Revision: D43167817

fbshipit-source-id: 45b1b4a3060cfd1e01356c003d63fa4b91c4222a
  • Loading branch information
vincentriemer authored and facebook-github-bot committed Feb 9, 2023
1 parent 6faddc3 commit d92cb73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions React/Fabric/RCTSurfaceTouchHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ - (void)_updateTouches:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
for (UITouch *touch in touches) {
auto iterator = _activeTouches.find(touch);
assert(iterator != _activeTouches.end() && "Inconsistency between local and UIKit touch registries");
RCTAssert(iterator != _activeTouches.end(), @"Inconsistency between local and UIKit touch registries");
if (iterator == _activeTouches.end()) {
continue;
}
Expand All @@ -605,7 +605,7 @@ - (void)_unregisterTouches:(NSSet<UITouch *> *)touches
{
for (UITouch *touch in touches) {
auto iterator = _activeTouches.find(touch);
assert(iterator != _activeTouches.end() && "Inconsistency between local and UIKit touch registries");
RCTAssert(iterator != _activeTouches.end(), @"Inconsistency between local and UIKit touch registries");
if (iterator == _activeTouches.end()) {
continue;
}
Expand Down Expand Up @@ -640,7 +640,7 @@ - (void)_unregisterTouches:(NSSet<UITouch *> *)touches

for (UITouch *touch in touches) {
auto iterator = _activeTouches.find(touch);
assert(iterator != _activeTouches.end() && "Inconsistency between local and UIKit touch registries");
RCTAssert(iterator != _activeTouches.end(), @"Inconsistency between local and UIKit touch registries");
if (iterator == _activeTouches.end()) {
continue;
}
Expand Down

0 comments on commit d92cb73

Please sign in to comment.