Leave field "wptCategoryNames" null if is null in the DB

This commit is contained in:
Alexander Sytnyk 2018-03-14 14:22:17 +02:00
parent 7f31a6861b
commit 52d01bfbc3
2 changed files with 4 additions and 3 deletions

View file

@ -493,7 +493,9 @@ public class GPXDatabase {
a.avgSpeed = avgSpeed; a.avgSpeed = avgSpeed;
a.points = points; a.points = points;
a.wptPoints = wptPoints; a.wptPoints = wptPoints;
if (wptCategoryNames != null) {
a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames); a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames);
}
File dir; File dir;
if (!Algorithms.isEmpty(fileDir)) { if (!Algorithms.isEmpty(fileDir)) {

View file

@ -126,8 +126,7 @@ public class AddTracksGroupBottomSheetDialogFragment extends AddGroupBottomSheet
GpxDataItem item = processedDataFiles.get(gpxFile); GpxDataItem item = processedDataFiles.get(gpxFile);
if (item == null if (item == null
|| item.getFileLastModifiedTime() != gpxFile.lastModified() || item.getFileLastModifiedTime() != gpxFile.lastModified()
|| item.getAnalysis().wptCategoryNames == null || item.getAnalysis().wptCategoryNames == null) {
|| (item.getAnalysis().wptPoints > 0 && item.getAnalysis().wptCategoryNames.isEmpty())) {
GPXFile f = GPXUtilities.loadGPXFile(app, gpxFile); GPXFile f = GPXUtilities.loadGPXFile(app, gpxFile);
GPXTrackAnalysis analysis = f.getAnalysis(gpxFile.lastModified()); GPXTrackAnalysis analysis = f.getAnalysis(gpxFile.lastModified());
if (item == null) { if (item == null) {