Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Don't throw IllegalStateException for invalid rows
Instead of having openFile() throw an IllegalStateException due to an invalid row, just return null, marking that there is no valid file. This will get bubbled up as a FileNotFoundException and handled appropriately.
  • Loading branch information
ianhanniballake committed Oct 27, 2016
1 parent 71b2f94 commit 7c9ee26
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -672,7 +672,8 @@ private File getCacheFileForArtworkUri(Uri artworkUri) {
return null;
}
if (!data.moveToFirst()) {
throw new IllegalStateException("Invalid URI: " + artworkUri);
Log.e(TAG, "Invalid artwork URI " + artworkUri);
return null;
}
// While normally we'd use data.getLong(), we later need this as a String so the automatic conversion helps here
String id = data.getString(0);
Expand Down

0 comments on commit 7c9ee26

Please sign in to comment.