diff --git a/app/src/main/java/app/fedilab/android/helper/Helper.java b/app/src/main/java/app/fedilab/android/helper/Helper.java index 2f3711b78..5d45fca42 100644 --- a/app/src/main/java/app/fedilab/android/helper/Helper.java +++ b/app/src/main/java/app/fedilab/android/helper/Helper.java @@ -1096,9 +1096,9 @@ public class Helper { SharedPreferences sharedpreferences = PreferenceManager.getDefaultSharedPreferences(context); boolean disableGif = sharedpreferences.getBoolean(context.getString(R.string.SET_DISABLE_GIF), false); String targetedUrl = disableGif ? account.mastodon_account.avatar_static : account.mastodon_account.avatar; - if (targetedUrl != null && Helper.isValidContextForGlide(view.getContext())) { + if (targetedUrl != null && Helper.isValidContextForGlide(context)) { if (disableGif || (!targetedUrl.endsWith(".gif"))) { - RequestBuilder requestBuilder = Glide.with(view.getContext()) + RequestBuilder requestBuilder = Glide.with(context) .asDrawable() .load(targetedUrl) .thumbnail(0.1f); @@ -1107,7 +1107,7 @@ public class Helper { } requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))).into(view); } else { - RequestBuilder requestBuilder = Glide.with(view.getContext()) + RequestBuilder requestBuilder = Glide.with(context) .asGif() .load(targetedUrl) .thumbnail(0.1f); @@ -1116,8 +1116,8 @@ public class Helper { } requestBuilder.apply(new RequestOptions().transform(new CenterCrop(), new RoundedCorners(10))).into(view); } - } else if (Helper.isValidContextForGlide(view.getContext())) { - Glide.with(view.getContext()) + } else if (Helper.isValidContextForGlide(context)) { + Glide.with(context) .asDrawable() .load(R.drawable.ic_person) .thumbnail(0.1f) @@ -1286,7 +1286,7 @@ public class Helper { } selectedFileInputStream.close(); } - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); } Handler mainHandler = new Handler(Looper.getMainLooper());