diff --git a/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh b/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh index 9e325106f821..fe3458cd21e8 100644 --- a/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh +++ b/pkgs/build-support/setup-hooks/set-source-date-epoch-to-latest.sh @@ -27,5 +27,7 @@ updateSourceDateEpoch() { postUnpackHooks+=(_updateSourceDateEpochFromSourceRoot) _updateSourceDateEpochFromSourceRoot() { - updateSourceDateEpoch "$sourceRoot" + if [ -n "$sourceRoot" ]; then + updateSourceDateEpoch "$sourceRoot" + fi }