init: use setup.c's repo version verification
[gitweb.git] / gitweb / gitweb.perl
index 7a5b23acf2155fb4e39dcb2f20944362cfbe0ac7..05d7910b7cdbd6fea7c835491caa774a46e4b7f8 100755 (executable)
@@ -7576,7 +7576,7 @@ sub git_object {
                        git_cmd(), 'cat-file', '-t', $object_id) . ' 2> /dev/null'
                        or die_error(404, "Object does not exist");
                $type = <$fd>;
-               chomp $type;
+               defined $type && chomp $type;
                close $fd
                        or die_error(404, "Object does not exist");