|
@@ -119,11 +119,17 @@ public class MediaProvider {
|
|
|
|
|
|
if (cursorImages != null) {
|
|
|
String filePath;
|
|
|
+ int failedImages = 0;
|
|
|
while (cursorImages.moveToNext()) {
|
|
|
filePath = cursorImages.getString(cursorImages.getColumnIndexOrThrow(
|
|
|
MediaStore.MediaColumns.DATA));
|
|
|
- mediaFolder.filePaths.add(filePath);
|
|
|
- mediaFolder.absolutePath = filePath.substring(0, filePath.lastIndexOf("/"));
|
|
|
+
|
|
|
+ if (filePath != null) {
|
|
|
+ mediaFolder.filePaths.add(filePath);
|
|
|
+ mediaFolder.absolutePath = filePath.substring(0, filePath.lastIndexOf("/"));
|
|
|
+ } else {
|
|
|
+ failedImages++;
|
|
|
+ }
|
|
|
}
|
|
|
cursorImages.close();
|
|
|
|
|
@@ -139,7 +145,7 @@ public class MediaProvider {
|
|
|
null);
|
|
|
|
|
|
if (count != null) {
|
|
|
- mediaFolder.numberOfFiles = count.getCount();
|
|
|
+ mediaFolder.numberOfFiles = count.getCount() - failedImages;
|
|
|
count.close();
|
|
|
}
|
|
|
|