ctx->failed = TRUE;
}
if (ctx->ctx.output != dbox_output) {
- /* e.g. zlib plugin had changed this */
- o_stream_ref(dbox_output);
- o_stream_destroy(&ctx->ctx.output);
- ctx->ctx.output = dbox_output;
+ if (ctx->ctx.output != NULL) {
+ /* e.g. zlib plugin had changed this */
+ o_stream_ref(dbox_output);
+ o_stream_destroy(&ctx->ctx.output);
+ ctx->ctx.output = dbox_output;
+ } else {
+ i_assert(ctx->failed);
+ }
}
index_mail_cache_parse_deinit(ctx->ctx.dest_mail,
ctx->ctx.received_date, !ctx->failed);