Bug 18215: Fix another tls warning
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 10 Mar 2017 08:17:02 +0000 (09:17 +0100)
committerBrendan A Gallagher <brendan@bywatersolutions.com>
Wed, 22 Mar 2017 21:00:41 +0000 (21:00 +0000)
Resolve warning:
Use of uninitialized value in string eq at C4/Installer.pm line 79.

Test plan:
Add a trivial .sql file in atomicupdate (comment is sufficient).
Run updatedatabase.pl
Without the patch you have the warning.
Apply the patch and repeat (no warning).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>

C4/Installer.pm

index e8692a1..866d1f2 100644 (file)
@@ -76,7 +76,7 @@ sub new {
     $self->{'user'}     = C4::Context->config("user");
     $self->{'password'} = C4::Context->config("pass");
     $self->{'tls'} = C4::Context->config("tls");
-    if ($self->{'tls'} eq 'yes'){
+    if( $self->{'tls'} && $self->{'tls'} eq 'yes' ) {
         $self->{'ca'} = C4::Context->config('ca');
         $self->{'cert'} = C4::Context->config('cert');
         $self->{'key'} = C4::Context->config('key');