Skip to content

Commit a3232e6

Browse files
authored
Merge pull request FRRouting#9733 from opensourcerouting/grpc-fix-missing
lib: fix gRPC crash on missing YANG node
2 parents f72b987 + 0f53885 commit a3232e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/northbound_grpc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,10 @@ static struct lyd_node *get_dnode_config(const std::string &path)
344344
{
345345
struct lyd_node *dnode;
346346

347+
if (!yang_dnode_exists(running_config->dnode,
348+
path.empty() ? NULL : path.c_str()))
349+
return NULL;
350+
347351
dnode = yang_dnode_get(running_config->dnode,
348352
path.empty() ? NULL : path.c_str());
349353
if (dnode)

0 commit comments

Comments
 (0)