summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--desktop-widgets/locationinformation.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/desktop-widgets/locationinformation.cpp b/desktop-widgets/locationinformation.cpp
index f10b2b766..b8cbd689d 100644
--- a/desktop-widgets/locationinformation.cpp
+++ b/desktop-widgets/locationinformation.cpp
@@ -203,9 +203,10 @@ void LocationInformationWidget::acceptChanges()
if (!ui.diveSiteCoordinates->text().isEmpty()) {
double lat, lon;
- parseGpsText(ui.diveSiteCoordinates->text(), &lat, &lon);
- currentDs->latitude.udeg = lrint(lat * 1000000.0);
- currentDs->longitude.udeg = lrint(lon * 1000000.0);
+ if (parseGpsText(ui.diveSiteCoordinates->text(), &lat, &lon)) {
+ currentDs->latitude.udeg = lrint(lat * 1000000.0);
+ currentDs->longitude.udeg = lrint(lon * 1000000.0);
+ }
}
if (dive_site_is_empty(currentDs)) {
LocationInformationModel::instance()->removeRow(get_divesite_idx(currentDs));