Commit dc6c5749 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Throw correct exception for null paths

Bug: 22519119
Change-Id: I8aff294201dfd8ec46ff3d30e4ceecea1346f29b
parent 55f76906
......@@ -4627,7 +4627,11 @@ public class MediaProvider extends ContentProvider {
throw new FileNotFoundException("No entry for " + uri);
case 1:
if (cursor.moveToFirst()) {
return new File(cursor.getString(0));
String data = cursor.getString(0);
if (data == null) {
throw new FileNotFoundException("Null path for " + uri);
}
return new File(data);
} else {
throw new FileNotFoundException("Unable to read entry for " + uri);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment