[Android] Fix NullPointerException
Nicolas Pomepuy
git at videolan.org
Thu Sep 12 16:34:26 CEST 2019
vlc-android | branch: master | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Wed Sep 11 08:54:03 2019 +0200| [128e763a71d2ff116d0a395da1d109919347f09b] | committer: Geoffrey Métais
Fix NullPointerException
> https://code.videolan.org/videolan/vlc-android/commit/128e763a71d2ff116d0a395da1d109919347f09b
---
medialibrary/src/org/videolan/medialibrary/Medialibrary.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
index 5eb03e201..3436f27df 100644
--- a/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
+++ b/medialibrary/src/org/videolan/medialibrary/Medialibrary.java
@@ -71,8 +71,10 @@ public class Medialibrary extends AbstractMedialibrary {
public void run() {
String[] children = oldDir.list();
- for (String child : children) {
- new File(oldDir, child).delete();
+ if (children != null) {
+ for (String child : children) {
+ new File(oldDir, child).delete();
+ }
}
oldDir.delete();
}
More information about the Android
mailing list