Skip null file in media library.
Looks like Samsung still returns 'null' here sometimes - for whatever reason.
This commit is contained in:
parent
f908a2ebb0
commit
3e8c74125f
@ -24,7 +24,7 @@ THE SOFTWARE.
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="ch.blinkenlights.android.vanilla"
|
||||
android:versionName="1.1.0"
|
||||
android:versionCode="11000"
|
||||
android:versionCode="11001"
|
||||
android:installLocation="auto">
|
||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
|
@ -171,6 +171,10 @@ public class MediaLibrary {
|
||||
defaultPaths.add(Environment.getExternalStorageDirectory().getAbsolutePath());
|
||||
|
||||
for (File file : context.getExternalMediaDirs()) {
|
||||
// Returns 'null' on some Samsung devices?!.
|
||||
if (file == null)
|
||||
continue;
|
||||
|
||||
defaultPaths.add(file.getAbsolutePath());
|
||||
// Check if we have access to a subdir which contains the 'Music' folder.
|
||||
while ( (file = file.getParentFile()) != null) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user