summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Yang <bin.y.yang@intel.com>2013-01-23 12:41:35 +0800
committerguojingx <guojingx.wu@intel.com>2014-04-29 17:23:57 +0800
commit5e585ccc80ad45b861a6cbce663afa5d3e903c5c (patch)
treec286bb4477846c7981c77f18cc72a6271b9e9bc0
parent8d193b8e027ac0ff4579370a31f997ae3af55b07 (diff)
downloadmms-5e585ccc80ad45b861a6cbce663afa5d3e903c5c.tar.gz
Can not download empty text file received in MMS
When the content of mms is empty,there will be a Nullpointer Exception, so User can't download the mms.Fix the null pointer when mms is empty. Change-Id: I3b2c71133f897daa5723f2b838f05b0e66ba1c36 Signed-off-by: Bin Yang <bin.y.yang@intel.com>
-rwxr-xr-x[-rw-r--r--]src/java/com/google/android/mms/pdu/PduPersister.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/java/com/google/android/mms/pdu/PduPersister.java b/src/java/com/google/android/mms/pdu/PduPersister.java
index 94f1430..c8288cc 100644..100755
--- a/src/java/com/google/android/mms/pdu/PduPersister.java
+++ b/src/java/com/google/android/mms/pdu/PduPersister.java
@@ -792,6 +792,9 @@ public class PduPersister {
|| ContentType.APP_SMIL.equals(contentType)
|| ContentType.TEXT_HTML.equals(contentType)) {
ContentValues cv = new ContentValues();
+ if (data == null) {
+ data = new String("").getBytes(CharacterSets.DEFAULT_CHARSET_NAME);
+ }
cv.put(Telephony.Mms.Part.TEXT, new EncodedStringValue(data).getString());
if (mContentResolver.update(uri, cv, null, null) != 1) {
throw new MmsException("unable to update " + uri.toString());