Prevent NPE b/c of race condition
This commit is contained in:
parent
5f1c78b4f4
commit
5f0ddbc15d
|
@ -177,13 +177,16 @@ public class AllEpisodesListAdapter extends BaseAdapter {
|
|||
|
||||
@Override
|
||||
public void onLoadFailed(Exception e, Drawable errorDrawable) {
|
||||
if(fallback.get() != null && placeholder.get() != null && cover.get() != null) {
|
||||
Uri fallbackUri = fallback.get();
|
||||
TextView txtvPlaceholder = placeholder.get();
|
||||
ImageView imgvCover = cover.get();
|
||||
if(fallbackUri != null && txtvPlaceholder != null && imgvCover != null) {
|
||||
Glide.with(context)
|
||||
.load(fallback.get())
|
||||
.load(fallbackUri)
|
||||
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
|
||||
.fitCenter()
|
||||
.dontAnimate()
|
||||
.into(new CoverTarget(null, placeholder.get(), cover.get()));
|
||||
.into(new CoverTarget(null, txtvPlaceholder, imgvCover));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -182,13 +182,16 @@ public class QueueListAdapter extends BaseAdapter {
|
|||
|
||||
@Override
|
||||
public void onLoadFailed(Exception e, Drawable errorDrawable) {
|
||||
if(fallback.get() != null && placeholder.get() != null && cover.get() != null) {
|
||||
Uri fallbackUri = fallback.get();
|
||||
TextView txtvPlaceholder = placeholder.get();
|
||||
ImageView imgvCover = cover.get();
|
||||
if(fallbackUri != null && txtvPlaceholder != null && imgvCover != null) {
|
||||
Glide.with(context)
|
||||
.load(fallback.get())
|
||||
.load(fallbackUri)
|
||||
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
|
||||
.fitCenter()
|
||||
.dontAnimate()
|
||||
.into(new CoverTarget(null, placeholder.get(), cover.get()));
|
||||
.into(new CoverTarget(null, txtvPlaceholder, imgvCover));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue