From 2a93f0626e2046c5ecba2445e8ead019734e9e3e Mon Sep 17 00:00:00 2001 From: AztecBot Date: Wed, 4 Mar 2026 18:37:01 +0000 Subject: [PATCH] fix: handle unbound variable in check_doc_references.sh The FILE_TO_DOCS_MAP associative array access on line 235 fails with 'set -u' (nounset) when the key doesn't exist yet. Using ${...:-} provides a default empty value to prevent the error. --- docs/scripts/check_doc_references.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/scripts/check_doc_references.sh b/docs/scripts/check_doc_references.sh index cf69741956e1..036ab53d4309 100755 --- a/docs/scripts/check_doc_references.sh +++ b/docs/scripts/check_doc_references.sh @@ -232,7 +232,7 @@ while IFS= read -r ref_file; do while IFS='|' read -r src_file doc_file; do if [[ "$src_file" == "$ref_file" ]]; then # Store in associative array (append to existing value if key exists) - if [[ -n "${FILE_TO_DOCS_MAP[$ref_file]}" ]]; then + if [[ -n "${FILE_TO_DOCS_MAP[$ref_file]:-}" ]]; then FILE_TO_DOCS_MAP[$ref_file]="${FILE_TO_DOCS_MAP[$ref_file]}|${doc_file}" else FILE_TO_DOCS_MAP[$ref_file]="$doc_file"