Merge pull request #37 from NixOS/fixup-new-chan

curRelease: guard against missing channel
This commit is contained in:
Graham Christensen 2020-04-12 21:40:26 -04:00 committed by GitHub
commit 7a681103b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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