User.pm: remove another source of uninitialized variable warnings
authorKyle J. McKay <mackyle@gmail.com>
Tue, 16 Jul 2013 12:17:57 +0000 (16 05:17 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Tue, 16 Jul 2013 12:17:57 +0000 (16 05:17 -0700)
Girocco/User.pm

index dde5e41..525affa 100644 (file)
@@ -310,7 +310,7 @@ sub keys_html_list {
 sub gen_auth {
        my $self = shift;
        my ($type) = @_;
-       $type = 'REPO' unless $type =~ /^[A-Z]+$/;
+       $type = 'REPO' unless $type && $type =~ /^[A-Z]+$/;
 
        $self->{authtype} = $type;
        $self->{auth} = sha1_hex(time . $$ . rand() . $self->{keys});