diff src/readpst.c @ 255:ab87f9070ed2 stable-0-6-49

fix to ignore embedded objects that are not email messages
author Carl Byington <carl@five-ten-sg.com>
date Mon, 13 Sep 2010 14:47:09 -0700
parents fb66d428347d
children c947b8812120
line wrap: on
line diff
--- a/src/readpst.c	Thu Sep 02 12:28:01 2010 -0700
+++ b/src/readpst.c	Mon Sep 13 14:47:09 2010 -0700
@@ -1012,9 +1012,13 @@
     if (!item) {
         DEBUG_WARN(("write_embedded_message: pst_parse_item was unable to parse the embedded message in attachment ID %llu", attach->i_id));
     } else {
-        fprintf(f_output, "\n--%s\n", boundary);
-        fprintf(f_output, "Content-Type: %s\n\n", attach->mimetype.str);
-        write_normal_email(f_output, "", item, MODE_NORMAL, 0, pf, 0, extra_mime_headers);
+        if (!item->email) {
+            DEBUG_WARN(("write_embedded_message: pst_parse_item returned type %d, not an email message", item->type));
+        } else {
+            fprintf(f_output, "\n--%s\n", boundary);
+            fprintf(f_output, "Content-Type: %s\n\n", attach->mimetype.str);
+            write_normal_email(f_output, "", item, MODE_NORMAL, 0, pf, 0, extra_mime_headers);
+        }
         pst_freeItem(item);
     }