aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-mime-part.c')
-rw-r--r--camel/camel-mime-part.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c
index 9dba5162a4..f372240347 100644
--- a/camel/camel-mime-part.c
+++ b/camel/camel-mime-part.c
@@ -544,8 +544,12 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
camel_object_unref((CamelObject *)crlf);
}
- camel_stream_filter_add(filter_stream, filter);
- camel_object_unref((CamelObject *)filter);
+
+ if (filter) {
+ camel_stream_filter_add(filter_stream, filter);
+ camel_object_unref((CamelObject *)filter);
+ }
+
stream = (CamelStream *)filter_stream;
}