Subject: | empty flags() returns scalar undef in list context |
In flags(), undef is returned if no flags are found:
$self->fetch($msg, "FLAGS")
or return undef;
This causes problems when called in list context as it returns a
one-element list with undef instead of the empty list. E.g. causing
problems in Mail::Transport::IMAP4::getflags().
Instead, just use a bare return to get undef in scalar context and an
empty list in list context:
$self->fetch($msg, "FLAGS")
or return;