]> Sergey Matveev's repositories - public-inbox.git/commitdiff
pktop: fix potential undefined var
authorEric Wong <e@80x24.org>
Tue, 2 Feb 2021 11:46:57 +0000 (11:46 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Feb 2021 07:32:41 +0000 (07:32 +0000)
In case we have other bugs in our code.

lib/PublicInbox/PktOp.pm

index 12839e71a8a11d8eabb067d8b0d9dd3c98fac960..59b37ff8129c3f8c6ac59e6115f01af0c50688cd 100644 (file)
@@ -58,7 +58,7 @@ sub event_step {
                        die "recv: $!";
                }
                my ($cmd, $pargs) = split(/\0/, $msg, 2);
-               my $op = $self->{ops}->{$cmd // $msg};
+               my $op = $self->{ops}->{$cmd //= $msg};
                die "BUG: unknown message: `$cmd'" unless $op;
                my ($sub, @args) = @$op;
                $sub->(@args, $pargs ? ipc_thaw($pargs) : ());