add a couple more path null checks

This commit is contained in:
tibbi 2016-11-06 15:38:34 +01:00
parent 657b14fdb4
commit 3f756369f2
2 changed files with 6 additions and 0 deletions

View File

@ -218,6 +218,9 @@ public class MediaActivity extends SimpleActivity
final int pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
do {
final String curPath = cursor.getString(pathIndex);
if (curPath == null)
continue;
if (curPath.matches(pattern) && !mToBeDeleted.contains(curPath)) {
final File file = new File(curPath);
if (file.exists()) {

View File

@ -384,6 +384,9 @@ public class ViewPagerActivity extends SimpleActivity
final int pathIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATA);
do {
final String curPath = cursor.getString(pathIndex);
if (curPath == null)
continue;
if (curPath.matches(pattern) && !curPath.equals(mToBeDeleted) && !curPath.equals(mBeingDeleted)) {
final int dateIndex = cursor.getColumnIndex(MediaStore.Images.Media.DATE_TAKEN);
final long timestamp = cursor.getLong(dateIndex);