Avoid warning about undefinded value when calling legend for the first time.
This commit is contained in:
parent
b6aab82949
commit
674160c45c
|
@ -6,7 +6,7 @@ use Data::Dumper;
|
||||||
use HTTP::Date qw(parse_date);
|
use HTTP::Date qw(parse_date);
|
||||||
use Time::Local qw(timegm_nocheck);
|
use Time::Local qw(timegm_nocheck);
|
||||||
|
|
||||||
$VERSION = do { my @r=(q$Revision: 1.6 $=~/\d+/g);sprintf "%d."."%02d"x$#r,@r};
|
$VERSION = do { my @r=(q$Revision: 1.7 $=~/\d+/g);sprintf "%d."."%02d"x$#r,@r};
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
my ($class, %opts) = @_;
|
my ($class, %opts) = @_;
|
||||||
|
@ -54,7 +54,7 @@ sub legend {
|
||||||
my ($self, @legend) = @_;
|
my ($self, @legend) = @_;
|
||||||
my $oldlegend = $self->{legend};
|
my $oldlegend = $self->{legend};
|
||||||
$self->{legend} = [@legend] if (@legend);
|
$self->{legend} = [@legend] if (@legend);
|
||||||
return @$oldlegend;
|
return $oldlegend ? @$oldlegend : ();
|
||||||
}
|
}
|
||||||
|
|
||||||
sub style {
|
sub style {
|
||||||
|
|
Loading…
Reference in New Issue