Fixed potential nullpointer exception
This commit is contained in:
parent
ef0ed07273
commit
6469bffe61
|
@ -461,12 +461,16 @@ public class DownloadService extends Service {
|
||||||
|
|
||||||
/** Delete files that aren't needed anymore */
|
/** Delete files that aren't needed anymore */
|
||||||
private void cleanup() {
|
private void cleanup() {
|
||||||
if (new File(feed.getFile_url()).delete())
|
if (feed.getFile_url() != null) {
|
||||||
if (AppConfig.DEBUG)
|
if (new File(feed.getFile_url()).delete())
|
||||||
Log.d(TAG, "Successfully deleted cache file.");
|
if (AppConfig.DEBUG)
|
||||||
else
|
Log.d(TAG, "Successfully deleted cache file.");
|
||||||
Log.e(TAG, "Failed to delete cache file.");
|
else
|
||||||
feed.setFile_url(null);
|
Log.e(TAG, "Failed to delete cache file.");
|
||||||
|
feed.setFile_url(null);
|
||||||
|
} else if (AppConfig.DEBUG) {
|
||||||
|
Log.d(TAG, "Didn't delete cache file: File url is not set.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue