fix crash when attempting login as user w/o 'catalogue' permission
authorGalen Charlton <galen.charlton@liblime.com>
Thu, 10 Apr 2008 16:37:48 +0000 (11:37 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Thu, 10 Apr 2008 20:53:38 +0000 (15:53 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Auth.pm

index ec0fe59..5c69ab3 100755 (executable)
@@ -1341,7 +1341,11 @@ sub haspermission {
                 return 0 unless ( $flags->{$module} == 1 or ref($flags->{$module}) );
             } else {
                 return 0 unless ( $flags->{$module} == 1 or
-                                    ( exists $flags->{$module}->{$subperm} and $flags->{$module}->{$subperm} == 1 ) );
+                                    ( ref($flags->{$module}) and 
+                                      exists $flags->{$module}->{$subperm} and 
+                                      $flags->{$module}->{$subperm} == 1 
+                                    ) 
+                                );
             }
         } else {
             return 0 unless ( $flags->{$module} );