From 52d01bfbc3742457f37606ed4b71ec202a1ce994 Mon Sep 17 00:00:00 2001 From: Alexander Sytnyk Date: Wed, 14 Mar 2018 14:22:17 +0200 Subject: [PATCH] Leave field "wptCategoryNames" null if is null in the DB --- OsmAnd/src/net/osmand/plus/GPXDatabase.java | 4 +++- .../mapmarkers/AddTracksGroupBottomSheetDialogFragment.java | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/GPXDatabase.java b/OsmAnd/src/net/osmand/plus/GPXDatabase.java index 88de874cfe..25f9350007 100644 --- a/OsmAnd/src/net/osmand/plus/GPXDatabase.java +++ b/OsmAnd/src/net/osmand/plus/GPXDatabase.java @@ -493,7 +493,9 @@ public class GPXDatabase { a.avgSpeed = avgSpeed; a.points = points; a.wptPoints = wptPoints; - a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames); + if (wptCategoryNames != null) { + a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames); + } File dir; if (!Algorithms.isEmpty(fileDir)) { diff --git a/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java b/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java index 7f84546256..639f243c10 100644 --- a/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/mapmarkers/AddTracksGroupBottomSheetDialogFragment.java @@ -126,8 +126,7 @@ public class AddTracksGroupBottomSheetDialogFragment extends AddGroupBottomSheet GpxDataItem item = processedDataFiles.get(gpxFile); if (item == null || item.getFileLastModifiedTime() != gpxFile.lastModified() - || item.getAnalysis().wptCategoryNames == null - || (item.getAnalysis().wptPoints > 0 && item.getAnalysis().wptCategoryNames.isEmpty())) { + || item.getAnalysis().wptCategoryNames == null) { GPXFile f = GPXUtilities.loadGPXFile(app, gpxFile); GPXTrackAnalysis analysis = f.getAnalysis(gpxFile.lastModified()); if (item == null) {