Merge pull request #9733 from opensourcerouting/grpc-fix-missing

lib: fix gRPC crash on missing YANG node
This commit is contained in:
Russ White 2021-10-05 19:24:34 -04:00 committed by GitHub
commit a3232e63e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -344,6 +344,10 @@ static struct lyd_node *get_dnode_config(const std::string &path)
{
struct lyd_node *dnode;
if (!yang_dnode_exists(running_config->dnode,
path.empty() ? NULL : path.c_str()))
return NULL;
dnode = yang_dnode_get(running_config->dnode,
path.empty() ? NULL : path.c_str());
if (dnode)