Skip to content

Fix NPE in ReactProgressBarViewManager.measure() with nullable params (#57035)#57035

Open
adityasharat wants to merge 1 commit into
facebook:mainfrom
adityasharat:export-D107178838
Open

Fix NPE in ReactProgressBarViewManager.measure() with nullable params (#57035)#57035
adityasharat wants to merge 1 commit into
facebook:mainfrom
adityasharat:export-D107178838

Conversation

@adityasharat
Copy link
Copy Markdown

@adityasharat adityasharat commented Jun 1, 2026

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

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 1, 2026
@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 1, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 1, 2026

@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
@meta-codesync meta-codesync Bot changed the title Fix NPE in ReactProgressBarViewManager.measure() with nullable params Fix NPE in ReactProgressBarViewManager.measure() with nullable params (#57035) Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant