fix crash when attempting login as user w/o 'catalogue' permission

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Galen Charlton 2008-04-10 11:37:48 -05:00 committed by Joshua Ferraro
parent fc6ccb1a61
commit 7a2a241fa3

View file

@ -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} );