Skip to content

added null check before initialising LatLng after receiving location … #1791

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

Merged

Conversation

ashishkumar468
Copy link
Collaborator

@ashishkumar468 ashishkumar468 commented Aug 4, 2018

…permission

Nearby crash fix

Fixes #1735 [Nearby crash when LatLng is null]

Description (required)

After receiving location permission from user, while fetching last known location, we used to initialise LatLng from last known location which could be fetched from either GPS_PROVIDER or NETWORK_PROVIDER. There was a null check on the one fetched from GPS_PROVIDER but not on the one fetched from NETWORK_PROVIDER.

Fixes #1735 [Nearby crash when LatLng is null]
Added a null check on the last known location fetched from NETWORK_PROVIDER

Tests performed (required)

Tested on {27 & emulator google pixel}, with {build variant, betaDebug}.

Screenshots showing what changed (optional)

NA

Copy link
Member

@maskaravivek maskaravivek left a comment

Choose a reason for hiding this comment

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

Please use the variable name on the next side of the expression.

@maskaravivek maskaravivek merged commit b73535f into commons-app:master Aug 4, 2018
@codecov-io
Copy link

Codecov Report

Merging #1791 into master will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1791      +/-   ##
=========================================
- Coverage    3.56%   3.56%   -0.01%     
=========================================
  Files         186     186              
  Lines        9329    9331       +2     
  Branches      811     812       +1     
=========================================
  Hits          333     333              
- Misses       8974    8976       +2     
  Partials       22      22
Impacted Files Coverage Δ
...e/nrw/commons/location/LocationServiceManager.java 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12a83da...faaaae0. Read the comment docs.

ujjwalagrawal17 pushed a commit to ujjwalagrawal17/apps-android-commons that referenced this pull request Aug 8, 2018
commons-app#1791)

* added null check before initialising LatLng after receiving location permission

* flipped null==lastKL with lastKL==null
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.

Nearby crash when LatLng is null
3 participants