-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Crash in our App fix #1096
Conversation
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)
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; |
There was a problem hiding this comment.
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
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. |
Thanks for this! Will be cutting a new release wit this in it soon |
I may be wrong but the stacktrace says that the GoogleMap object is null, not the Projection object. |
I am also having the same problem with the latest release. |
I've created another Pull request for this issue, you can find it here #1469 |
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)