fixed unitialized warning when timezone !found

fixed a warning that occurred when the timezone name parsed from
$input_timezone was not found in the %timezones hash
master
Dylan Lloyd 2013-01-16 03:56:56 -05:00
parent 6b0d754c61
commit 8c38618625
1 changed files with 5 additions and 0 deletions

View File

@ -146,7 +146,12 @@ handle query => sub {
s/\s+//g;
}
my $gmt_input_timezone = parse_timezone $input_timezone;
# parse_timezone returns undef if the timezone name parsed
# from #input_timezone is not found in %timezones
return unless defined $gmt_input_timezone;
my $gmt_output_timezone = parse_timezone $output_timezone;
$modifier += $gmt_output_timezone - $gmt_input_timezone;
for ( $gmt_input_timezone, $gmt_output_timezone ) {
$_ = to_time $_;