Repository navigation
fix(android): accept null for unset tile source and Image props - #4453
Merged
Merged
Conversation
mfazekas
force-pushed
the
fix/android-null-props-sweep
branch
from
November 27, 2026 05:16
91accac to
cdb9604
Compare
This branch was previously deployed
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.
Description
Follow-up to #4454 and #4455. On Android, unsetting
minZoomLevel,maxZoomLevelortmsonVectorSource/RasterSource, orsdfonImage, makes Fabric send null. That null crashed inDynamicFromObject.asX()(ClassCastException: Dynamic value from Object is not a number/boolean). These setters now treat null as unset. The PR also removes the// unset: ...comments #4455 added, which restate the code. ThepreferredFramesPerSecondcomment stays, because the code can't show why null keeps the current cap.followPaddingis unchanged. Unsetting it already stores zero insets, which removes the padding. Storing null would fall back tocameraState.paddingand keep the old padding, which I checked on the emulator.Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Screenshot OR Video
Release build on an Android emulator; each prop was unset after a fresh launch.
On main (09058de), all 7 crash:
VectorSource/RasterSourceminZoomLevel: crash inRNMBXTileSourceManager.setMinZoomLevelVectorSource/RasterSourcemaxZoomLevel: crash inRNMBXTileSourceManager.setMaxZoomLevelVectorSource/RasterSourcetms: crash inRNMBXTileSourceManager.setTmsImagesdf: crash inRNMBXImageManager.setSdfWith this PR there are no crashes. The run included unsetting every prop, setting them all again, and remounting. Unsetting
followPaddingrecenters the puck, and setting it again moves the puck back down, both on main and with this PR.Component to reproduce the issue you're fixing
Toggle reproducer (tap a button to unset or set that prop)