Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash in our App fix #1096

Merged
merged 1 commit into from
Mar 26, 2017
Merged

Crash in our App fix #1096

merged 1 commit into from
Mar 26, 2017

Conversation

thegdznet
Copy link
Contributor

java.lang.NullPointerException: Attempt to invoke virtual method
'com.google.android.gms.maps.Projection
com.google.android.gms.maps.GoogleMap.getProjection()' on a null object
reference
at com.airbnb.android.react.maps.AirMapView$13.run(AirMapView.java:643)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5289)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.ja
va:899)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)

java.lang.NullPointerException: Attempt to invoke virtual method
'com.google.android.gms.maps.Projection
com.google.android.gms.maps.GoogleMap.getProjection()' on a null object
reference
	at com.airbnb.android.react.maps.AirMapView$13.run(AirMapView.java:643)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:135)
	at android.app.ActivityThread.main(ActivityThread.java:5289)
	at java.lang.reflect.Method.invoke(Native Method)
	at java.lang.reflect.Method.invoke(Method.java:372)
	at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.ja
va:899)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
@christopherdro
Copy link
Collaborator

lgtm

/cc @felipecsl

LatLngBoundsUtils.BoundsAreDifferent(bounds, lastBoundsEmitted)) {
Projection projection = map.getProjection();
VisibleRegion region = (projection != null) ? projection.getVisibleRegion() : null;
LatLngBounds bounds = (region != null) ? region.latLngBounds : null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: you don't need the parenthesis around projection != null and region != null

@thegdznet
Copy link
Contributor Author

Many thanx to accept my pull request. Do You know when the changes will be reflected to master?

Concerning the parenthesis, they are there only for visibility. You can remove them if You prefer.

@lelandrichardson lelandrichardson merged commit 9d2a84e into react-native-maps:master Mar 26, 2017
@lelandrichardson
Copy link
Collaborator

Thanks for this! Will be cutting a new release wit this in it soon

@Hoolii
Copy link

Hoolii commented May 17, 2017

I may be wrong but the stacktrace says that the GoogleMap object is null, not the Projection object.
The fix only does a null check on the Projection object, not the GoogleMap object.
I still have a crash because of this.

@nikolay-radkov
Copy link
Contributor

I am also having the same problem with the latest release.

@nikolay-radkov
Copy link
Contributor

I've created another Pull request for this issue, you can find it here #1469

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.

None yet

6 participants