Fix possible IllegalArgumentException due to npe inside sql db

This commit is contained in:
Chumva 2019-11-28 14:22:42 +02:00
parent cbf1173308
commit 1b876fc93b

View file

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