Skip to content

Commit caa3812

Browse files
committed
Ignore all errors when getting free storage space
It's not a critical check that needs to be perfomed, so in case something does not work on some device/version, let's just ignore the error.
1 parent c3c39a7 commit caa3812

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/src/main/java/org/schabi/newpipe/streams/io/StoredDirectoryHelper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import android.net.Uri;
1212
import android.os.ParcelFileDescriptor;
1313
import android.provider.DocumentsContract;
14-
import android.system.ErrnoException;
1514
import android.system.Os;
1615
import android.system.StructStatVfs;
1716
import android.util.Log;
@@ -207,7 +206,9 @@ public long getFreeStorageSpace() {
207206

208207
// this is the same formula used inside the FsStat class
209208
return stat.f_bavail * stat.f_frsize;
210-
} catch (final IOException | ErrnoException e) {
209+
} catch (final Throwable e) {
210+
// ignore any error
211+
Log.e(TAG, "Could not get free storage space", e);
211212
return Long.MAX_VALUE;
212213
}
213214
}

0 commit comments

Comments
 (0)