OSDN Git Service

null check
authorMark Wagner <mxw@google.com>
Mon, 22 Mar 2010 18:43:24 +0000 (11:43 -0700)
committerMark Wagner <mxw@google.com>
Mon, 22 Mar 2010 18:43:24 +0000 (11:43 -0700)
Change-Id: I3ee3efb8588a5b6b7368b8c5b0e43a07d1427ad8

core/java/com/google/android/mms/pdu/PduPersister.java

index 2a1f23a..d4ac24a 100644 (file)
@@ -424,7 +424,8 @@ public class PduPersister {
                     // faster.
                     if ("text/plain".equals(type) || "application/smil".equals(type)) {
                         String text = c.getString(PART_COLUMN_TEXT);
-                        byte [] blob = new EncodedStringValue(text).getTextString();
+                        byte [] blob = new EncodedStringValue(text != null ? text : "")
+                            .getTextString();
                         baos.write(blob, 0, blob.length);
                     } else {
 
@@ -858,7 +859,7 @@ public class PduPersister {
         } else {
             values.put(Mms.SUBJECT, "");
         }
-        
+
         long messageSize = sendReq.getMessageSize();
         if (messageSize > 0) {
             values.put(Mms.MESSAGE_SIZE, messageSize);