From afbcd2dc694d4a13a0651dc52f44e17d2fb9be20 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 22 Jan 2020 20:33:57 +0100 Subject: [PATCH] Gravatar not found is to be expected --- app/src/main/java/eu/faircode/email/ContactInfo.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ContactInfo.java b/app/src/main/java/eu/faircode/email/ContactInfo.java index a7e69ca534..62c88df4f2 100644 --- a/app/src/main/java/eu/faircode/email/ContactInfo.java +++ b/app/src/main/java/eu/faircode/email/ContactInfo.java @@ -182,10 +182,11 @@ public class ContactInfo { urlConnection.connect(); int status = urlConnection.getResponseCode(); - if (status != HttpURLConnection.HTTP_OK) + if (status == HttpURLConnection.HTTP_OK) + info.bitmap = BitmapFactory.decodeStream(urlConnection.getInputStream()); + else if (status != HttpURLConnection.HTTP_NOT_FOUND) throw new IOException("HTTP status=" + status); - info.bitmap = BitmapFactory.decodeStream(urlConnection.getInputStream()); } catch (Throwable ex) { Log.w(ex); } finally {