aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/cgWaypoint.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/cgWaypoint.java b/main/src/cgeo/geocaching/cgWaypoint.java
index ba49a97..ac3b8c5 100644
--- a/main/src/cgeo/geocaching/cgWaypoint.java
+++ b/main/src/cgeo/geocaching/cgWaypoint.java
@@ -75,21 +75,23 @@ public class cgWaypoint implements IWaypoint, Comparable<cgWaypoint> {
// copy user modified details of the waypoints
if (newPoints != null && oldPoints != null) {
for (cgWaypoint old : oldPoints) {
- boolean merged = false;
- if (old != null && old.getName() != null && old.getName().length() > 0) {
- for (cgWaypoint waypoint : newPoints) {
- if (waypoint != null && waypoint.getName() != null) {
- if (old.getName().equalsIgnoreCase(waypoint.getName())) {
- waypoint.merge(old);
- merged = true;
- break;
+ if (old != null) {
+ boolean merged = false;
+ if (old.getName() != null && old.getName().length() > 0) {
+ for (cgWaypoint waypoint : newPoints) {
+ if (waypoint != null && waypoint.getName() != null) {
+ if (old.getName().equalsIgnoreCase(waypoint.getName())) {
+ waypoint.merge(old);
+ merged = true;
+ break;
+ }
}
}
}
- }
- // user added waypoints should also be in the new list
- if (!merged) {
- newPoints.add(old);
+ // user added waypoints should also be in the new list
+ if (!merged && old.isUserDefined()) {
+ newPoints.add(old);
+ }
}
}
}