From 03ab49aeeb0c7c64216efcc817255d8790af4d1d Mon Sep 17 00:00:00 2001 From: Stephen Rothwell Date: Sat, 29 Sep 2018 12:09:18 +1000 Subject: [PATCH] fetch_trees: explicitly check that a tree exists --- fetch_trees | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fetch_trees b/fetch_trees index 87e1b6c..2747e92 100755 --- a/fetch_trees +++ b/fetch_trees @@ -108,9 +108,13 @@ for name in $trees; do } type=$(get_field "$name" 2) + if ! [ "$type" ]; then + printf "%s: unknown tree\n" "$name" 1>&2 + continue + fi echo $name: $type - [ $(type -t "fetch_$type") = "function" ] && + [ "$(type -t fetch_$type)" = "function" ] && fetch_$type "$name" done -- 2.39.5