Skip to content

Commit

Permalink
#162 Invalid index 0, size is 0 on GeoUtils
Browse files Browse the repository at this point in the history
#162 Invalid index 0, size is 0 on GeoUtils
  • Loading branch information
galadril committed Dec 31, 2015
1 parent e82b433 commit a0713de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/nl/hnogames/domoticz/PlanActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected void onCreate(Bundle savedInstanceState) {
Bundle bundle = getIntent().getExtras();
if (bundle == null)
this.finish();

//noinspection SpellCheckingInspection
String selectedPlan = bundle.getString("PLANNAME");
//noinspection SpellCheckingInspection
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/java/nl/hnogames/domoticz/Utils/GeoUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ public Address getAddressFromLatLng(LatLng mLatLong) {
try {
addressList = mGeocoder.getFromLocation(mLatLong.latitude, mLatLong.longitude, 5);

if (addressList == null) {
if (addressList == null || addressList.size() <= 0) {
return null;
}
mAddress = addressList.get(0);

mAddress = addressList.get(0);//get first

} catch (IOException e) {
e.printStackTrace();
Expand Down

0 comments on commit a0713de

Please sign in to comment.