curRelease: guard against missing channel

This commit is contained in:
Graham Christensen 2020-04-12 21:35:26 -04:00
parent ed29118df9
commit 3e3304d0f7
No known key found for this signature in database
GPG key ID: FE918C3A98C1030F

View file

@ -112,7 +112,12 @@ print STDERR " - release is: $releaseName (build $releaseId)\n - eval is: $evalI
if ($bucketChannels) { if ($bucketChannels) {
# Guard against the channel going back in time. # Guard against the channel going back in time.
my $curRelease = $bucketChannels->get_key($channelName)->{'x-amz-website-redirect-location'} // ""; my $curRelease = "";
if (defined(my $object = $bucketChannels->get_key($channelName))) {
$curRelease = $object->{'x-amz-website-redirect-location'} // "";
}
if (!defined $ENV{'FORCE'}) { if (!defined $ENV{'FORCE'}) {
print STDERR "previous release is $curRelease\n"; print STDERR "previous release is $curRelease\n";
$! = 0; # Clear errno to avoid reporting non-fork/exec-related issues $! = 0; # Clear errno to avoid reporting non-fork/exec-related issues