summaryrefslogtreecommitdiff
path: root/src/completion.ml
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2026-01-08 12:36:42 +0000
committerGitHub <noreply@github.com>2026-01-08 12:36:42 +0000
commitb6f617f77dd8673a31339feeef01728bd8e3ec63 (patch)
treea9e05957e21b6bcc6b307283a31aaf2d3934b158 /src/completion.ml
parentc2d199b78fe2cbdc6918e359a68cff92fcae37b7 (diff)
parentd090f624dd1f000a2b1bc55ee91636af38e575f8 (diff)
downloadvyos1x-config-b6f617f77dd8673a31339feeef01728bd8e3ec63.tar.gz
vyos1x-config-b6f617f77dd8673a31339feeef01728bd8e3ec63.zip
Merge pull request #62 from jestabro/misplaced-check-in-completion-env
T8156: fix misplaced check for Nonexistent_path in get completion env
Diffstat (limited to 'src/completion.ml')
-rw-r--r--src/completion.ml9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/completion.ml b/src/completion.ml
index ff04cb2..d1530de 100644
--- a/src/completion.ml
+++ b/src/completion.ml
@@ -85,17 +85,14 @@ let get_completion_env rtree ctree op cpath =
let cnode =
match path with
| [] -> ctree
- | _ -> (Vytree.get[@alert "-exn"]) ctree path
+ | _ -> try (Vytree.get[@alert "-exn"]) ctree path
+ with Vytree.Nonexistent_path -> Config_tree.default
in
let children =
let child_set = Vytree.children_of_node rnode in
if not restricted then child_set
else
- let extant_children =
- try
- Vytree.list_children cnode
- with Vytree.Nonexistent_path -> []
- in
+ let extant_children = Vytree.list_children cnode in
let is_extant s =
List.mem (Vytree.name_of_node s) extant_children
in