Commit 117f3c9
Return null from resolveView for stopped surfaces (#55737)
Summary:
Pull Request resolved: #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: 0f68e0ffc8b2c891aa33c408e427acd7e1e5b8291 parent 8230f3b commit 117f3c9
File tree
1 file changed
+4
-1
lines changed- packages/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric
1 file changed
+4
-1
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1059 | 1059 | | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | | - | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
1063 | 1066 | | |
1064 | 1067 | | |
1065 | 1068 | | |
| |||
0 commit comments