The final entry of {wbuf} may be a CODE ref and not a
tmpio ARRAY ref, so we must ensure it's an ARRAY before
attempting to use `->[INDEX]' to access it.
This fixes:
forward ->close error: Not an ARRAY reference at PublicInbox/DS.pm line 544.
push @$wbuf, $bref;
} else {
my $tmpio = $wbuf->[-1];
- if ($tmpio && !defined($tmpio->[2])) { # append to tmp file buffer
+ if (ref($tmpio) eq 'ARRAY' && !defined($tmpio->[2])) {
+ # append to tmp file buffer
$tmpio->[0]->print($$bref) or return drop($self, "print: $!");
} else {
my $tmpio = tmpio($self, $bref, 0) or return 0;