From 11329a72ef26375baf4e7f0264687160884ed836 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 14 Apr 2017 15:37:59 +0300 Subject: [PATCH] Fix PointDescription --- OsmAnd/src/net/osmand/data/PointDescription.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/OsmAnd/src/net/osmand/data/PointDescription.java b/OsmAnd/src/net/osmand/data/PointDescription.java index 1fb67ec9ce..cc1aa2e641 100644 --- a/OsmAnd/src/net/osmand/data/PointDescription.java +++ b/OsmAnd/src/net/osmand/data/PointDescription.java @@ -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); } @@ -180,14 +185,14 @@ public class PointDescription { } else if (f == PointDescription.OLC_FORMAT) { try { return getLocationOlcName(lat, lon); - } catch(RuntimeException e) { + } 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"; }