Add check for size of places

This commit is contained in:
misaochan 2016-10-07 17:32:19 +13:00
parent df11e65806
commit 4af6dbd5e2

View file

@ -318,10 +318,12 @@ public class NearbyListFragment extends ListFragment implements TaskListener {
); );
} }
for(int i = 0; i < 500; i++) { if (places.size() > 0) {
Place place = places.get(i); for (int i = 0; i < 100; i++) {
String distance = formatDistanceBetween(mLatestLocation, place.location); Place place = places.get(i);
place.setDistance(distance); String distance = formatDistanceBetween(mLatestLocation, place.location);
place.setDistance(distance);
}
} }
return places; return places;
} }