add a couple more path null checks
This commit is contained in:
parent
657b14fdb4
commit
3f756369f2
2 changed files with 6 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue