Skip to content

Commit

Permalink
Dont print error if apteryx_path_node passed NULL tree
Browse files Browse the repository at this point in the history
It is commonly used to check if a tree has a path and that
tree may be completely empty.
  • Loading branch information
carlgsmith committed Apr 16, 2024
1 parent 44de645 commit 8230c81
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apteryx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,11 @@ apteryx_path_node (GNode *node, const char *path)
char *node_name;
size_t node_name_len;

ASSERT (node != NULL && path != NULL, return false, "PATH_NODE: Invalid parameters\n");
ASSERT (path != NULL, return NULL, "PATH_NODE: Invalid parameters\n");

/* Common practice to try to find a path in an empty tree */
if (node == NULL)
return NULL;

/* Check path */
path = validate_path (path, NULL);
Expand Down

0 comments on commit 8230c81

Please sign in to comment.