From 377660c3561265faeb493cf044d59b68646cb635 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Tue, 9 Jun 2015 12:53:07 +0200 Subject: [PATCH] email: catch the correct exception while closing the buffers BinaryTempFileBody#getBody()#getInputStream() returns a MessagingException not an IOException. This causes "com.android.emailcommon.mail.MessagingException: Unable to open body" exception messages and attachment messages not flagged as loaded. Change-Id: Ia8f25dd0a212ce52e3dd202c523c5db4a009604f Signed-off-by: Jorge Ruesga --- provider_src/com/android/email/provider/Utilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provider_src/com/android/email/provider/Utilities.java b/provider_src/com/android/email/provider/Utilities.java index e28c873c4..718ac227e 100644 --- a/provider_src/com/android/email/provider/Utilities.java +++ b/provider_src/com/android/email/provider/Utilities.java @@ -178,7 +178,7 @@ public class Utilities { if (is != null) { is.close(); } - } catch (IOException io) { + } catch (IOException | MessagingException io) { // Ignore } }