summaryrefslogtreecommitdiff
path: root/python/vyos
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2020-07-01 14:53:23 -0500
committerJohn Estabrook <jestabro@vyos.io>2020-07-01 14:53:23 -0500
commita088c20d20ecb3735c19ee19010741073f24cba0 (patch)
tree2f856ea99447468d90c617d0d023eb8af133cf23 /python/vyos
parent3c973c0852de9342a94ae3df7c3d927b0a600032 (diff)
downloadvyos-1x-a088c20d20ecb3735c19ee19010741073f24cba0.tar.gz
vyos-1x-a088c20d20ecb3735c19ee19010741073f24cba0.zip
config: T2667: add missing check
Diffstat (limited to 'python/vyos')
-rw-r--r--python/vyos/config.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py
index 0bbfece6e..4ebb68a09 100644
--- a/python/vyos/config.py
+++ b/python/vyos/config.py
@@ -300,7 +300,7 @@ class Config(object):
config_tree = vyos.configtree.ConfigTree(res)
config_dict = json.loads(config_tree.to_json())
config_dict = vyos.util.get_sub_dict(config_dict, self._make_path(path))
- if get_first_key:
+ if get_first_key and path and config_dict:
tmp = next(iter(config_dict.values()))
if not isinstance(tmp, dict):
raise TypeError("Data under node is not of type dict")