Skip to content

Commit

Permalink
fix NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
tranleduy2000 committed Jun 7, 2018
1 parent fc3969b commit 699fa25
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@ protected LocalFile(Parcel in) {

private static boolean deleteRecursive(File fileOrDirectory) {
if (fileOrDirectory.isDirectory()) {
for (File child : fileOrDirectory.listFiles()) {
deleteRecursive(child);
File[] files = fileOrDirectory.listFiles();
if (files != null) {
for (File child : files) {
deleteRecursive(child);
}
}
}
return fileOrDirectory.delete();
Expand Down

0 comments on commit 699fa25

Please sign in to comment.