summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2026-01-05 15:18:09 -0600
committerJohn Estabrook <jestabro@vyos.io>2026-01-06 15:26:54 -0600
commitd090f624dd1f000a2b1bc55ee91636af38e575f8 (patch)
treea5db02806f3733f3856b1b775487b96546566fe6 /src
parent6cae8dc757c436972485f6e9baa5f4adf8e5e300 (diff)
downloadvyos1x-config-d090f624dd1f000a2b1bc55ee91636af38e575f8.tar.gz
vyos1x-config-d090f624dd1f000a2b1bc55ee91636af38e575f8.zip
T8156: fix misplaced check for Nonexistent_path in get completion env
Diffstat (limited to 'src')
-rw-r--r--src/completion.ml9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/completion.ml b/src/completion.ml
index 4b84a99..35a283f 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