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

Commit 01249440 authored by Lais Andrade's avatar Lais Andrade
Browse files

Fix NPE on ShutdownCheckPoints

Fix list files to handle null File array while filtering for existing checkpoint dump files for cleanup.

Change-Id: I275d9a87996425392feb42362c967eb1cdcba80b
Fix: 256460338
Test: ShutdownCheckPointsTest
parent 03882bc8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,7 @@ public final class ShutdownCheckPoints {
    private static final int MAX_DUMP_FILES = 20;
    private static final SimpleDateFormat DATE_FORMAT =
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS z");
    private static final File[] EMPTY_FILE_ARRAY = {};

    private final ArrayList<CheckPoint> mCheckPoints;
    private final Injector mInjector;
@@ -381,6 +382,9 @@ public final class ShutdownCheckPoints {
                    return true;
                }
            });
            if (files == null) {
                return EMPTY_FILE_ARRAY;
            }
            Arrays.sort(files);
            return files;
        }