mirror of
https://codeberg.org/Bazsalanszky/Infinity-For-Lemmy.git
synced 2025-01-02 14:27:10 +01:00
Fix crash in GlideImageGetter.
This commit is contained in:
parent
c21d59e979
commit
4904d46cb2
@ -58,13 +58,18 @@ public class GlideImageGetter implements Html.ImageGetter {
|
|||||||
|
|
||||||
BitmapDrawablePlaceholder drawable = new BitmapDrawablePlaceholder(textSize);
|
BitmapDrawablePlaceholder drawable = new BitmapDrawablePlaceholder(textSize);
|
||||||
|
|
||||||
Context context = container.get().getContext();
|
container.get().post(() -> {
|
||||||
if (!(context instanceof Activity && (((Activity) context).isFinishing() || ((Activity) context).isDestroyed()))) {
|
TextView textView = container.get();
|
||||||
container.get().post(() -> Glide.with(context)
|
if (textView != null) {
|
||||||
.asBitmap()
|
Context context = textView.getContext();
|
||||||
.load(source)
|
if (!(context instanceof Activity && (((Activity) context).isFinishing() || ((Activity) context).isDestroyed()))) {
|
||||||
.into(drawable));
|
Glide.with(context)
|
||||||
}
|
.asBitmap()
|
||||||
|
.load(source)
|
||||||
|
.into(drawable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return drawable;
|
return drawable;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user