Fix NullPointerException when checking if storage exists

This commit is contained in:
Stypox 2021-07-27 11:36:14 +02:00
parent 39722a5563
commit 1822d21676
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23
2 changed files with 2 additions and 2 deletions

View File

@ -285,7 +285,7 @@ public class StoredFileHelper implements Serializable {
}
public boolean existsAsFile() {
if (source == null) {
if (source == null || (docFile == null && ioFile == null)) {
return false;
}

View File

@ -664,7 +664,7 @@ public class DownloadMission extends Mission {
* @return {@code true}, if storage is invalid and cannot be used
*/
public boolean hasInvalidStorage() {
return errCode == ERROR_PROGRESS_LOST || storage == null || storage.isInvalid() || !storage.existsAsFile();
return errCode == ERROR_PROGRESS_LOST || storage == null || !storage.existsAsFile();
}
/**