From 3e3304d0f7813cb5057383c6c9b93f396ef09269 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Sun, 12 Apr 2020 21:35:26 -0400 Subject: [PATCH] curRelease: guard against missing channel --- mirror-nixos-branch.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mirror-nixos-branch.pl b/mirror-nixos-branch.pl index 3022a72..665d01e 100755 --- a/mirror-nixos-branch.pl +++ b/mirror-nixos-branch.pl @@ -112,7 +112,12 @@ print STDERR " - release is: $releaseName (build $releaseId)\n - eval is: $evalI if ($bucketChannels) { # 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'}) { print STDERR "previous release is $curRelease\n"; $! = 0; # Clear errno to avoid reporting non-fork/exec-related issues