Fix possible IllegalArgumentException due to npe inside sql db
This commit is contained in:
parent
cbf1173308
commit
1b876fc93b
1 changed files with 2 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue