diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2014-04-02 13:47:44 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2014-04-02 13:47:44 +0200 |
| commit | e122fbf8a43ec5575615fce457dd99073ff9553d (patch) | |
| tree | c82056bf66a5152ed2ac9d1ab5d0e974b9ed3b96 /main/src | |
| parent | 6caf61a70647a901a4c2e7521c99c2fc39a3f571 (diff) | |
| download | cgeo-e122fbf8a43ec5575615fce457dd99073ff9553d.zip cgeo-e122fbf8a43ec5575615fce457dd99073ff9553d.tar.gz cgeo-e122fbf8a43ec5575615fce457dd99073ff9553d.tar.bz2 | |
fix #2729: crash on GPX export
Diffstat (limited to 'main/src')
| -rw-r--r-- | main/src/cgeo/geocaching/export/GpxSerializer.java | 8 |
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"); |
