diff options
Diffstat (limited to 'main/src/cgeo/geocaching/cgeopoint.java')
-rw-r--r-- | main/src/cgeo/geocaching/cgeopoint.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/cgeopoint.java b/main/src/cgeo/geocaching/cgeopoint.java index 9b8d1bb..a7906bf 100644 --- a/main/src/cgeo/geocaching/cgeopoint.java +++ b/main/src/cgeo/geocaching/cgeopoint.java @@ -522,13 +522,10 @@ public class cgeopoint extends AbstractActivity { if (StringUtils.isNotBlank(bearingText) && StringUtils.isNotBlank(distanceText)) { // bearing & distance - Double bearing = null; + double bearing = 0; try { - bearing = new Double(bearingText); - } catch (Exception e) { - // probably not a number - } - if (bearing == null) { + bearing = Double.parseDouble(bearingText); + } catch (NumberFormatException e) { helpDialog(res.getString(R.string.err_point_bear_and_dist_title), res.getString(R.string.err_point_bear_and_dist)); return null; } |