mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2024-11-25 20:42:34 +01:00
Fix NullPointerException when checking if storage exists
This commit is contained in:
parent
39722a5563
commit
1822d21676
@ -285,7 +285,7 @@ public class StoredFileHelper implements Serializable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean existsAsFile() {
|
public boolean existsAsFile() {
|
||||||
if (source == null) {
|
if (source == null || (docFile == null && ioFile == null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -664,7 +664,7 @@ public class DownloadMission extends Mission {
|
|||||||
* @return {@code true}, if storage is invalid and cannot be used
|
* @return {@code true}, if storage is invalid and cannot be used
|
||||||
*/
|
*/
|
||||||
public boolean hasInvalidStorage() {
|
public boolean hasInvalidStorage() {
|
||||||
return errCode == ERROR_PROGRESS_LOST || storage == null || storage.isInvalid() || !storage.existsAsFile();
|
return errCode == ERROR_PROGRESS_LOST || storage == null || !storage.existsAsFile();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user