Return null from resolveView for stopped surfaces#55737
Closed
javache wants to merge 1 commit intofacebook:mainfrom
Closed
Return null from resolveView for stopped surfaces#55737javache wants to merge 1 commit intofacebook:mainfrom
javache wants to merge 1 commit intofacebook:mainfrom
Conversation
Summary: `FabricUIManager.resolveView` can throw `IllegalViewOperationException` when called with a tag belonging to a stopped surface. This happens because `getSurfaceManagerForView` returns a stopped `SurfaceMountingManager` (via `tagSetForStoppedSurface`), but `getView` then throws since `tagToViewState` was cleared during `stopSurface()`. Add an `isStopped()` check before calling `getView`, returning `null` instead. This follows the same pattern already used by `measure()` and `measureText()` in the same file. Changelog: [Internal] Fixes T257147576. Differential Revision: D94347789
cortinico
approved these changes
Feb 25, 2026
Contributor
cortinico
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
|
This pull request has been merged in 117f3c9. |
Collaborator
|
This pull request was successfully merged by @javache in 117f3c9 When will my fix make it into a release? | How to file a pick request? |
zoontek
pushed a commit
to zoontek/react-native
that referenced
this pull request
Mar 9, 2026
Summary: Pull Request resolved: facebook#55737 `FabricUIManager.resolveView` can throw `IllegalViewOperationException` when called with a tag belonging to a stopped surface. This happens because `getSurfaceManagerForView` returns a stopped `SurfaceMountingManager` (via `tagSetForStoppedSurface`), but `getView` then throws since `tagToViewState` was cleared during `stopSurface()`. Add an `isStopped()` check before calling `getView`, returning `null` instead. This follows the same pattern already used by `measure()` and `measureText()` in the same file. Changelog: [Internal] Fixes T257147576. Reviewed By: cortinico Differential Revision: D94347789 fbshipit-source-id: 0f68e0ffc8b2c891aa33c408e427acd7e1e5b829
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
FabricUIManager.resolveViewcan throwIllegalViewOperationExceptionwhen called with a tag belonging to a stopped surface. This happens becausegetSurfaceManagerForViewreturns a stoppedSurfaceMountingManager(viatagSetForStoppedSurface), butgetViewthen throws sincetagToViewStatewas cleared duringstopSurface().Add an
isStopped()check before callinggetView, returningnullinstead. This follows the same pattern already used bymeasure()andmeasureText()in the same file.Changelog: [Internal]
Fixes T257147576.
Differential Revision: D94347789