Fix open location crash

This commit is contained in:
Alexey 2017-04-14 15:36:40 +03:00 committed by GitHub
parent 91872cdf3e
commit 52127f9bd4

View file

@ -158,12 +158,17 @@ public class PointDescription {
return pnt.zone_number + "" + pnt.zone_letter + " " + ((long) pnt.easting) + " "
+ ((long) pnt.northing);
} else if (f == PointDescription.OLC_FORMAT) {
return getLocationOlcName(lat, lon);
try {
return getLocationOlcName(lat, lon);
} catch (RuntimeException e) {
e.printStackTrace();
return "0+0";
}
} else {
try {
return ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, LocationConvert.convert(lat, f),
LocationConvert.convert(lon, f));
} catch(RuntimeException e) {
} catch (RuntimeException e) {
e.printStackTrace();
return ctx.getString(sh ? R.string.short_location_on_map : R.string.location_on_map, 0, 0);
}
@ -178,11 +183,16 @@ public class PointDescription {
return pnt.zone_number + "" + pnt.zone_letter + " " + ((long) pnt.easting) + " "
+ ((long) pnt.northing);
} else if (f == PointDescription.OLC_FORMAT) {
return getLocationOlcName(lat, lon);
try {
return getLocationOlcName(lat, lon);
} catch (RuntimeException e) {
e.printStackTrace();
return "0+0";
}
} else {
try {
return LocationConvert.convert(lat, f) + ", " + LocationConvert.convert(lon, f);
} catch(RuntimeException e) {
} catch (RuntimeException e) {
e.printStackTrace();
return "0, 0";
}
@ -366,4 +376,4 @@ public class PointDescription {
}
}
}
}