diff --git a/OsmAnd/src/net/osmand/plus/GPXDatabase.java b/OsmAnd/src/net/osmand/plus/GPXDatabase.java index 0c97bce910..623bbfb2b9 100644 --- a/OsmAnd/src/net/osmand/plus/GPXDatabase.java +++ b/OsmAnd/src/net/osmand/plus/GPXDatabase.java @@ -501,8 +501,9 @@ public class GPXDatabase { } private String getFileDir(File itemFile) { - return itemFile.getParentFile() == null ? "" + String fileDir = itemFile.getParentFile() == null ? "" : new File(itemFile.getPath().replace(context.getAppPath(IndexConstants.GPX_INDEX_DIR).getPath() + "/", "")).getParent(); + return fileDir != null ? fileDir : ""; } void insert(GpxDataItem item, SQLiteConnection db) {