Fix crash if no external storage.

Change-Id: If5b0386b686d65cf9026a3c00459db371ab81b3a
This commit is contained in:
Dianne Hackborn
2011-04-20 10:19:05 -07:00
parent df92f2e1e2
commit 6c28e35b82

View File

@@ -425,7 +425,7 @@ public class MemoryMeasurement {
File top = Environment.getExternalStorageDirectory(); File top = Environment.getExternalStorageDirectory();
mFileInfoForMisc = new ArrayList<FileInfo>(); mFileInfoForMisc = new ArrayList<FileInfo>();
File[] files = top.listFiles(); File[] files = top.listFiles();
int len = files.length; int len = files != null ? files.length : 0;
if (len == 0) { if (len == 0) {
return; return;
} }