Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5badf06 authored by Craig Mautner's avatar Craig Mautner
Browse files

Add null check to TaskPersister file list.

Ran out of file descriptors and got a null file list. This
checks for null file list.

Fixes bug 17461213.

Change-Id: Ia6d49d0bdb6da98623b76d2b87cd09bc0afa1f27
parent df980618
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -347,6 +347,10 @@ public class TaskPersister {
    private static void removeObsoleteFiles(ArraySet<Integer> persistentTaskIds, File[] files) {
        if (DEBUG) Slog.d(TAG, "removeObsoleteFile: persistentTaskIds=" + persistentTaskIds +
                " files=" + files);
        if (files == null) {
            Slog.e(TAG, "File error accessing recents directory (too many files open?).");
            return;
        }
        for (int fileNdx = 0; fileNdx < files.length; ++fileNdx) {
            File file = files[fileNdx];
            String filename = file.getName();