static void pipe_attachment(FILE *fp, struct Body *b, struct State *state)
{
- FILE *ifp = NULL;
+ if (!state || !state->fpout)
+ return;
if (fp)
{
}
else
{
- ifp = fopen(b->filename, "r");
+ FILE *ifp = fopen(b->filename, "r");
if (!ifp)
{
mutt_perror("fopen");
mutt_mktemp(newfile, sizeof(newfile));
if (mutt_decode_save_attachment(fp, top, newfile, MUTT_PRINTING, 0) == 0)
{
+ if (!state->fpout)
+ {
+ mutt_error("BUG in print_attachment_list(). Please report this. ");
+ return;
+ }
+
ifp = fopen(newfile, "r");
if (ifp)
{