aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsudev <rasch@munin-soft.de>2015-10-03 00:01:36 +0200
committerrsudev <rasch@munin-soft.de>2015-10-03 00:01:36 +0200
commit596c9e4e77d22cb75ffdbf92331da604f66b878d (patch)
tree2fdc9a696307c1277573330ec09dfea42f723b30
parent93c69b5b8244d3e27503e00efb28a86a4396b812 (diff)
downloadcgeo-596c9e4e77d22cb75ffdbf92331da604f66b878d.zip
cgeo-596c9e4e77d22cb75ffdbf92331da604f66b878d.tar.gz
cgeo-596c9e4e77d22cb75ffdbf92331da604f66b878d.tar.bz2
Fixes #5213, Sometimes NPE in SaveWaypoint
- check for valid state before attempting save
-rw-r--r--main/src/cgeo/geocaching/EditWaypointActivity.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/EditWaypointActivity.java b/main/src/cgeo/geocaching/EditWaypointActivity.java
index 062ceca..25f3acd 100644
--- a/main/src/cgeo/geocaching/EditWaypointActivity.java
+++ b/main/src/cgeo/geocaching/EditWaypointActivity.java
@@ -516,6 +516,11 @@ public class EditWaypointActivity extends AbstractActionBarActivity implements C
@Override
protected Void doInBackground(final Void... params) {
+ // currentState might be null here if there is a problem with the waypoints data
+ if (currentState == null) {
+ finishHandler.sendEmptyMessage(SAVE_ERROR);
+ return null;
+ }
final Waypoint waypoint = new Waypoint(currentState.name, currentState.type, own);
waypoint.setGeocode(geocode);
waypoint.setPrefix(prefix);