Skip to content

Commit

Permalink
Fix loading images from db even if disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Aug 13, 2023
1 parent e68b511 commit 69ee195
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ private static RequestCreator loadImageDefault(@Nullable final String url,
private static RequestCreator loadImageDefault(@Nullable final String url,
final int placeholderResId,
final boolean showPlaceholderWhileLoading) {
if (isNullOrEmpty(url)) {
// if the URL was chosen with `choosePreferredImage` it will be null, but check again
// `shouldLoadImages` in case the URL was chosen with `imageListToDbUrl` (which is the case
// for URLs stored in the database)
if (isNullOrEmpty(url) || !ImageStrategy.shouldLoadImages()) {
return picassoInstance
.load((String) null)
.placeholder(placeholderResId) // show placeholder when no image should load
Expand Down

0 comments on commit 69ee195

Please sign in to comment.