From d40fea942359011a472405ea5f5b04637809a6d4 Mon Sep 17 00:00:00 2001 From: Moxie Marlinspike Date: Tue, 10 Oct 2017 09:18:00 -0700 Subject: [PATCH] Catch Glide exception when loading avatar image Workaround for #7016 // FREEIBE --- .../securesms/contacts/avatars/ContactPhotoFactory.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/thoughtcrime/securesms/contacts/avatars/ContactPhotoFactory.java b/src/org/thoughtcrime/securesms/contacts/avatars/ContactPhotoFactory.java index 095883c8ab..cd622b4ca7 100644 --- a/src/org/thoughtcrime/securesms/contacts/avatars/ContactPhotoFactory.java +++ b/src/org/thoughtcrime/securesms/contacts/avatars/ContactPhotoFactory.java @@ -9,6 +9,7 @@ import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.support.annotation.WorkerThread; import android.text.TextUtils; +import android.util.Log; import com.bumptech.glide.Glide; import com.bumptech.glide.load.engine.DiskCacheStrategy; @@ -92,6 +93,10 @@ public class ContactPhotoFactory { .get(); return new BitmapContactPhoto(bitmap); + } catch (IllegalArgumentException e) { + Log.w(TAG, e); + // XXX This is a temporary fix for #7016 until we upgrade to Glide 4 as a next step + return getDefaultContactPhoto(name); } catch (ExecutionException e) { return getDefaultContactPhoto(name); } catch (InterruptedException e) {