Skip to content

Fix crash of nearby list when the places list is null #673

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
merged 3 commits into from
May 27, 2017

Conversation

tobias47n9e
Copy link
Member

Currently the NearbyController crashes when it is called with a
places list that is null. This is caused by the NearbyMapFragment
not handling this state correctly.
This commit adds tests for an empty list and null, which reproduce
the problem. An early return in the NearbyController can make
the tests pass, but might not be the best solution for this issue.

Currently the NearbyController crashes when it is called with a
places list that is null. This is caused by the NearbyMapFragment
not handling this state correctly.
This commit adds tests for an empty list and null, which reproduce
the problem. An early return in the NearbyController can make
the tests pass, but might not be the best solution for this issue.
@tobias47n9e
Copy link
Member Author

tobias47n9e commented May 24, 2017

Related but maybe not best solution for #672

The fix causes the map to have no markers, if the places list happens to be null.

@misaochan
Copy link
Member

The Travis build fails due to failing tests. Are these the same tests that you wrote?

@tobias47n9e
Copy link
Member Author

It says:

fr.free.nrw.commons.SettingsActivityTest > 
afterClickingCcby4ItWillStay[test(AVD) - 5.1.1] FAILED 

android.support.test.espresso.NoMatchingViewException: No views in hierarchy found 
matching: (is descendant of a: with id: fr.free.nrw.commons:id/settingsFragment and 
with res-name that is "list" and has focus on the screen to the user)

f the target view is not part of the view hierarchy, you may need to use Espresso.onData 
to load it from one of the following AdapterViews:android.widget.ListView{263b671c 
VFED.VC. ......I. 0,0-480,678 #102000a android:id/list}

:app:connectedDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

The test passes locally. Will see if rerunning travis will help once again.

@tobias47n9e
Copy link
Member Author

I passed the tests now. I will still deal with the codacy checks.

@misaochan misaochan merged commit 0112a09 into commons-app:master May 27, 2017
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.

2 participants