Subject: | Issue in sub flags() in Mail/IMAPClient.pm when requesting a single message in array context. |
Date: | Thu, 13 Sep 2018 01:25:40 +0200 |
To: | bug-Mail-IMAPClient [...] rt.cpan.org |
From: | Gilles LAMIRAL <gilles [...] lamiral.info> |
Hi Phil,
Usage example:
my @flags = $imap->flags( 42 ) ;
In sub flags(), near the end, the line 2487 needs a small patch:
# or did the guy want just one response? Return it if so
- my $flagsref = $flagset->{$msgspec};
+ my $flagsref = $flagset->{$msgspec} || [];
Without this patch, a request to an unknown message, or a "void" response from
the imap server, ends the program badly with:
Can't use an undefined value as an ARRAY reference at W/Mail-IMAPClient-3.39/lib/Mail/IMAPClient.pm line 2488.
Thanks in advance!
--
Au revoir,
Gilles Lamiral. France, Baulon (35580)
mob 06 19 22 03 54
tel 09 51 84 42 42