Skip to content

Commit f29c314

Browse files
mebrianlinmobile-devx-github-bot
authored andcommitted
Properly propagate touch injector error.
PiperOrigin-RevId: 770306093
1 parent 184a28a commit f29c314

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

AppFramework/Event/GREYTouchInjector.m

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ - (BOOL)grey_injectTouches:(GREYTouchInfo *)touchInfo
330330
ongoingTouches:(NSMutableArray<UITouch *> *)ongoingTouches
331331
exception:(NSException **)exception {
332332
GREYFatalAssertMainThread();
333-
id injectionException;
333+
334334
UITouchesEvent *event = [UIApplication.sharedApplication _touchesEvent];
335335
[self grey_updateUITouchObjectsFromTouchInfo:touchInfo
336336
ongoingTouches:ongoingTouches
@@ -385,12 +385,13 @@ - (BOOL)grey_injectTouches:(GREYTouchInfo *)touchInfo
385385
@autoreleasepool {
386386
[UIApplication.sharedApplication sendEvent:event];
387387
}
388-
} @catch (id exception) {
389-
injectionException = exception;
388+
} @catch (id injectionException) {
389+
*exception = injectionException;
390+
return false;
390391
} @finally {
391392
[event _setHIDEvent:NULL];
392393
}
393-
return !injectionException;
394+
return true;
394395
}
395396

396397
/**

0 commit comments

Comments
 (0)