TPAC: Silence one uninit variable warning user/berick/tpac_silence_warning_2.2
authorBill Erickson <berick@esilibrary.com>
Wed, 15 Aug 2012 17:21:24 +0000 (13:21 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 15 Aug 2012 17:21:24 +0000 (13:21 -0400)
This warning was being thrown on every TPAC page request, slowly
filling the logs:

Use of uninitialized value $set_locale in string eq at
/usr/local/share/perl/5.10.1/OpenILS/WWW/EGWeb.pm line 159.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm

index 71a520c..984d232 100644 (file)
@@ -155,7 +155,7 @@ sub load_context {
     $ctx->{locales} = \%registered_locales;
 
     # Set a locale cookie if the requested locale is valid
-    my $set_locale = $cgi->param('set_eg_locale');
+    my $set_locale = $cgi->param('set_eg_locale') || '';
     if (!(grep {$_ eq $set_locale} keys %registered_locales)) {
         $set_locale = '';
     } else {