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

Fix IndexOutOfBounds exception in Nearby #1385

Merged
merged 3 commits into from
Mar 28, 2018

Conversation

misaochan
Copy link
Member

@misaochan misaochan commented Mar 28, 2018

Prevents IndexOutOfBounds crash in #1329 . Adds a check for the size of the places array to ensure that we only get() from it if the array is not empty.

Tested on API 25 Nexus S. Unfortunately the error seems to be random and not easily reproducible (so I don't know if it was fixed), however the changes have no adverse effects at least.

@codecov-io
Copy link

Codecov Report

Merging #1385 into 2.7.x-release will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@               Coverage Diff                @@
##           2.7.x-release   #1385      +/-   ##
================================================
- Coverage           3.33%   3.33%   -0.01%     
================================================
  Files                128     128              
  Lines               6769    6771       +2     
  Branches             656     657       +1     
================================================
  Hits                 226     226              
- Misses              6528    6530       +2     
  Partials              15      15
Impacted Files Coverage Δ
...a/fr/free/nrw/commons/nearby/NearbyController.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 4c1bf1b...0ec77b3. Read the comment docs.

@neslihanturan
Copy link
Collaborator

Exactly same thing what I was planning, I am either not sure if it fixes the bug. But it should. Thanks @misaochan

@neslihanturan neslihanturan merged commit 286581d into commons-app:2.7.x-release Mar 28, 2018
@misaochan misaochan deleted the fix-index-error branch March 28, 2018 12:20
Apochens added a commit to Apochens/Commons that referenced this pull request Sep 16, 2021
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