Commit 6234106d authored by Gang Wu's avatar Gang Wu Committed by Commit Bot

Add null check before for loop using the list

The bug was introduced by https://chromium-review.googlesource.com/c/chromium/src/+/2032427
and code was moved to here by https://chromium-review.googlesource.com/c/chromium/src/+/2063037

Bug: 1053790
Change-Id: I683351902f635ba329c14ccaec87540c36758cdf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2075418Reviewed-by: default avatarGayane Petrosyan <gayane@chromium.org>
Commit-Queue: Gang Wu <gangwu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745076}
parent 864dcb75
......@@ -64,8 +64,11 @@ public class ShareImageFileUtils {
boolean anyChildKept = false;
if (file.isDirectory()) {
for (File child : file.listFiles()) {
anyChildKept |= deleteFiles(child, reservedFilepath);
File[] file_list = file.listFiles();
if (file_list != null) {
for (File child : file.listFiles()) {
anyChildKept |= deleteFiles(child, reservedFilepath);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment