Skip to content

Commit

Permalink
fix bug that deleted files that were downloading!
Browse files Browse the repository at this point in the history
  • Loading branch information
paleolimbot committed Nov 15, 2016
1 parent c3f9bac commit ce3d424
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ protected void addToMap(GoogleMap map, GeoMapSheet sheet) {
if(sheet.hasGroundOverlayOptions()) {
GroundOverlay result = sheet.addGroundOverlay(map);
if(result == null) {
Toast.makeText(context, "Error adding " + sheet.getNTSSheet().getNtsId(), Toast.LENGTH_SHORT).show();
// delete offending file (is probably corrupted)
File mapfile = cache.getMapFile(sheet.getNTSSheet()) ;
if(!mapfile.delete()) {
Log.e("NTSImageTile", "addToMap: failed to delete " + mapfile);
}
Log.e("NTSImageTile", "Error adding " + sheet.getNTSSheet().getNtsId());
// do not delete file DO NOT DO IT it is just downloading
// deleting this file causes many problems
}
}
}
Expand Down

0 comments on commit ce3d424

Please sign in to comment.