From: Stephen Rothwell Date: Sat, 29 Sep 2018 02:09:18 +0000 (+1000) Subject: fetch_trees: explicitly check that a tree exists X-Git-Url: https://git.ozlabs.org/?a=commitdiff_plain;h=03ab49aeeb0c7c64216efcc817255d8790af4d1d;p=next-scripts fetch_trees: explicitly check that a tree exists --- 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