aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/export/GpxSerializer.java
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-04-02 13:47:44 +0200
committerSamuel Tardieu <sam@rfc1149.net>2014-04-02 13:47:44 +0200
commite122fbf8a43ec5575615fce457dd99073ff9553d (patch)
treec82056bf66a5152ed2ac9d1ab5d0e974b9ed3b96 /main/src/cgeo/geocaching/export/GpxSerializer.java
parent6caf61a70647a901a4c2e7521c99c2fc39a3f571 (diff)
downloadcgeo-e122fbf8a43ec5575615fce457dd99073ff9553d.zip
cgeo-e122fbf8a43ec5575615fce457dd99073ff9553d.tar.gz
cgeo-e122fbf8a43ec5575615fce457dd99073ff9553d.tar.bz2
fix #2729: crash on GPX export
Diffstat (limited to 'main/src/cgeo/geocaching/export/GpxSerializer.java')
-rw-r--r--main/src/cgeo/geocaching/export/GpxSerializer.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/export/GpxSerializer.java b/main/src/cgeo/geocaching/export/GpxSerializer.java
index 962f0d3..fef91cf 100644
--- a/main/src/cgeo/geocaching/export/GpxSerializer.java
+++ b/main/src/cgeo/geocaching/export/GpxSerializer.java
@@ -8,6 +8,7 @@ import cgeo.geocaching.Waypoint;
import cgeo.geocaching.enumerations.CacheAttribute;
import cgeo.geocaching.enumerations.LoadFlags;
import cgeo.geocaching.geopoint.Geopoint;
+import cgeo.geocaching.utils.Log;
import cgeo.geocaching.utils.SynchronizedDateFormat;
import cgeo.geocaching.utils.TextUtils;
import cgeo.geocaching.utils.XmlUtils;
@@ -258,7 +259,12 @@ public final class GpxSerializer {
gpx.startTag(PREFIX_GROUNDSPEAK, "text");
gpx.attribute("", "encoded", "False");
- gpx.text(log.log);
+ try {
+ gpx.text(log.log);
+ } catch (final IllegalArgumentException e) {
+ Log.e("GpxSerializer.writeLogs: cannot write log " + log.id + " for cache " + cache.getGeocode(), e);
+ gpx.text(" [end of log omitted due to an invalid character]");
+ }
gpx.endTag(PREFIX_GROUNDSPEAK, "text");
gpx.endTag(PREFIX_GROUNDSPEAK, "log");