Skip to content

[android crash] Fix exception when animating region during initialization#901

Merged
christopherdro merged 1 commit intoreact-native-maps:masterfrom
opendoor-labs:fix_null_crash_calling_map
Dec 27, 2016
Merged

[android crash] Fix exception when animating region during initialization#901
christopherdro merged 1 commit intoreact-native-maps:masterfrom
opendoor-labs:fix_null_crash_calling_map

Conversation

@mlanter
Copy link
Copy Markdown
Contributor

@mlanter mlanter commented Dec 15, 2016

Fixes a crash cause by calling animateToRegion on the map while it is still be initialized.

To reproduce:
In the componentDidMount of the component that renders the MapView add a this._map.animateToRegion(region, 1500);.

Basically on the native side we haven't initialized the map variable yet (which happens in onMapReady) so if that's the case we can't do an animateToRegion yet.

screenshot-2016-12-15_14 08 08 230

@mlanter
Copy link
Copy Markdown
Contributor Author

mlanter commented Dec 15, 2016

cc: @spikebrehm

@christopherdro christopherdro merged commit 51d94da into react-native-maps:master Dec 27, 2016
@spikebrehm
Copy link
Copy Markdown

Released as v0.12.3

pinpong pushed a commit to pinpong/react-native-maps that referenced this pull request Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants