Bug 13419: (QA followup) remove useless warnings
authorTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 22 Apr 2015 17:58:05 +0000 (14:58 -0300)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 22 Apr 2015 17:59:12 +0000 (14:59 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Auth.pm

index f5e3316..0e1b03f 100644 (file)
@@ -1949,11 +1949,13 @@ sub haspermission {
         if ( $subperm eq '*' ) {
             return 0 unless ( $flags->{$module} == 1 or ref( $flags->{$module} ) );
         } else {
-            return 0 unless ( $flags->{$module} == 1 or
+            return 0 unless (
+                ( defined $flags->{$module} and
+                    $flags->{$module} == 1 )
+                or
                 ( ref( $flags->{$module} ) and
                     exists $flags->{$module}->{$subperm} and
-                    $flags->{$module}->{$subperm} == 1
-                )
+                    $flags->{$module}->{$subperm} == 1 )
             );
         }
     }