Fix NPE in ReactProgressBarViewManager.measure() with nullable params (#57035)#57035
Open
adityasharat wants to merge 1 commit into
Open
Fix NPE in ReactProgressBarViewManager.measure() with nullable params (#57035)#57035adityasharat wants to merge 1 commit into
adityasharat wants to merge 1 commit into
Conversation
|
@adityasharat has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107178838. |
…facebook#57035) Summary: Match `ViewManager.measure()`'s Java signature (which has always accepted nullable `localData`/`props`/`state`) and the sibling `ReactSwitchManager.kt` pattern. The Kotlin migration in D49551193 (2024-07) wrongly tightened the override on `ReactProgressBarViewManager` to non-null `ReadableMap`, which threw NPE on entry whenever the C++ side passed `nullptr` for `localData` or `state` — which `AndroidProgressBarMeasurementsManager::measure` has always done. The latent bug was masked by Yoga's measure cache plus the now-removed `AndroidProgressBarMeasurementsManager` measurement cache (removed in D60192289, 2025-06). D105720159's CSS Flexbox §4.5 auto-min-size probe reliably bypasses Yoga's cache by calling `node->measure(... AtMost 0 ...)` per flex item, exposing the NPE and crashing Airwave on Android (T273821098, P2359486686). Fix: change `localData`/`props`/`state` to nullable `ReadableMap?` and use safe call on `props?.getString(...)`. This unblocks D105720159 from being re-landed. Differential Revision: D107178838
b549471 to
ee7f36b
Compare
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:
Match
ViewManager.measure()'s Java signature (which has always accepted nullablelocalData/props/state) and the siblingReactSwitchManager.ktpattern. The Kotlin migration in D49551193 (2024-07) wrongly tightened the override onReactProgressBarViewManagerto non-nullReadableMap, which threw NPE on entry whenever the C++ side passednullptrforlocalDataorstate— whichAndroidProgressBarMeasurementsManager::measurehas always done.The latent bug was masked by Yoga's measure cache plus the now-removed
AndroidProgressBarMeasurementsManagermeasurement cache (removed in D60192289, 2025-06). D105720159's CSS Flexbox §4.5 auto-min-size probe reliably bypasses Yoga's cache by callingnode->measure(... AtMost 0 ...)per flex item, exposing the NPE and crashing Airwave on Android (T273821098, P2359486686).Fix: change
localData/props/stateto nullableReadableMap?and use safe call onprops?.getString(...). This unblocks D105720159 from being re-landed.Differential Revision: D107178838