Merge pull request #8001 from osmandapp/small_fixes

Fix possible crash
This commit is contained in:
Vitaliy 2019-11-28 14:42:13 +02:00 committed by GitHub
commit 600030d03f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -501,8 +501,9 @@ public class GPXDatabase {
} }
private String getFileDir(File itemFile) { 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(); : new File(itemFile.getPath().replace(context.getAppPath(IndexConstants.GPX_INDEX_DIR).getPath() + "/", "")).getParent();
return fileDir != null ? fileDir : "";
} }
void insert(GpxDataItem item, SQLiteConnection db) { void insert(GpxDataItem item, SQLiteConnection db) {