handle error if no active currency is defined
authorGalen Charlton <gmcharlt@gmail.com>
Wed, 27 Jan 2010 14:30:22 +0000 (09:30 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Wed, 27 Jan 2010 14:30:22 +0000 (09:30 -0500)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
admin/preferences.pl

index 5c59e5d..01fd72e 100755 (executable)
@@ -43,8 +43,13 @@ sub GetTab {
 
     my $tab_template = C4::Output::gettemplate( 'admin/preferences/' . $tab . '.pref', 'intranet', $input );
 
+    my $active_currency = GetCurrency();
+    my $local_currency;
+    if ($currency) {
+        $local_currency = $active_currency->{currency};
+    }
     $tab_template->param(
-        local_currency => GetCurrency()->{'currency'}, # currency code is used, because we do not know how a given currency is formatted.
+        local_currency => $local_currency, # currency code is used, because we do not know how a given currency is formatted.
     );
 
     return YAML::Syck::Load( $tab_template->output() );