Commits

Predrag Stanojevic  committed aee4b75

Force closed at settings application when delete Misc files

NullPointerException in MiscFilesHandler.java, missing check to
ensure that dir.list() does not return null.

Change-Id: I13aac19949826b385610fd1fee2befb411684023

  • Participants
  • Parent commits f141594

Comments (0)

Files changed (1)

File src/com/android/settings/deviceinfo/MiscFilesHandler.java

         // Returns true if all deletions were successful.
         // If a deletion fails, the method stops attempting to delete and returns false.
         private boolean deleteDir(File dir) {
-            if (dir.isDirectory()) {
-                String[] children = dir.list();
+            String[] children = dir.list();
+            if (children != null) {
                 for (int i=0; i < children.length; i++) {
                     boolean success = deleteDir(new File(dir, children[i]));
                     if (!success) {
             return view;
         }
     }
-}
+}