]> Sergey Matveev's repositories - public-inbox.git/commitdiff
git: do not dereference undef as ARRAY ref
authorEric Wong <e@80x24.org>
Thu, 17 Feb 2022 20:27:12 +0000 (20:27 +0000)
committerEric Wong <e@80x24.org>
Thu, 17 Feb 2022 21:03:25 +0000 (21:03 +0000)
When aborting git processes, we must account for the lack of
inflight requests.

lib/PublicInbox/Git.pm

index 54ceaf0b8a5d6935f9101dbf52a45c4155eeb90f..b2ae75c8ae312042562c35dc568047bc8af49a0e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: GPLv2 or later <https://www.gnu.org/licenses/gpl-2.0.txt>
 #
 # Used to read files from a git repository without excessive forking.
@@ -349,7 +349,7 @@ sub async_abort ($) {
        while (scalar(@{$self->{inflight_c} // []}) ||
                        scalar(@{$self->{inflight} // []})) {
                for my $c ('', '_c') {
-                       my $q = $self->{"inflight$c"};
+                       my $q = $self->{"inflight$c"} or next;
                        while (@$q) {
                                my ($req, $cb, $arg) = splice(@$q, 0, 3);
                                $req = $$req if ref($req);