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.points = points;
a.wptPoints = wptPoints;
a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames);
if (wptCategoryNames != null) {
a.wptCategoryNames = Algorithms.decodeStringSet(wptCategoryNames);
}
File dir;
if (!Algorithms.isEmpty(fileDir)) {

View file

@ -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) {