bug 4333 followup - fix an uninitialized value warning

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
This commit is contained in:
Galen Charlton 2010-04-30 05:49:19 -04:00
parent 7604bf89f5
commit 59a6072c77

View file

@ -181,9 +181,6 @@ sub add_form {
sub add_validate {
$template->param( add_validate => 1 );
if ( $input->param('active') == 1 ) {
$dbh->do('UPDATE currency SET active = 0');
}
my $rec = {
rate => $input->param('rate'),
symbol => $input->param('symbol') || q{},
@ -191,6 +188,10 @@ sub add_validate {
currency => $input->param('currency'),
};
if ( $rec->{active} == 1 ) {
$dbh->do('UPDATE currency SET active = 0');
}
my ($row_count) = $dbh->selectrow_array(
'select count(*) as count from currency where currency = ?',
{}, $input->param('currency') );