From d0b54a29489314935214db920180fa208fc3a8ec Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Fri, 2 May 2014 16:42:46 -0700 Subject: [PATCH] Don't allow empty or null filenames b/14500106 Change-Id: I519e4a0fe392c3bdbb84f1ccbdea89f07b9c1426 --- .../com/android/emailcommon/utility/AttachmentUtilities.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emailcommon/src/com/android/emailcommon/utility/AttachmentUtilities.java b/emailcommon/src/com/android/emailcommon/utility/AttachmentUtilities.java index 2b324b0a9..aab255802 100644 --- a/emailcommon/src/com/android/emailcommon/utility/AttachmentUtilities.java +++ b/emailcommon/src/com/android/emailcommon/utility/AttachmentUtilities.java @@ -410,7 +410,7 @@ public class AttachmentUtilities { size = copyFile(in, resolver.openOutputStream(attUri)); contentUri = attUri.toString(); } else if (Utility.isExternalStorageMounted()) { - if (attachment.mFileName == null) { + if (TextUtils.isEmpty(attachment.mFileName)) { // TODO: This will prevent a crash but does not surface the underlying problem // to the user correctly. LogUtils.w(Logging.LOG_TAG, "Trying to save an attachment with no name: %d",