Skip to content

Commit 9d50e77

Browse files
committed
plugins types UPDATE ctx_node is not required
1 parent 057a280 commit 9d50e77

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/plugins_types.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -837,8 +837,9 @@ lyplg_type_lypath_new(const struct ly_ctx *ctx, const char *value, size_t value_
837837
uint32_t prefix_opt = 0;
838838
struct ly_err_item *e;
839839
const char *err_fmt = NULL;
840+
uint16_t oper;
840841

841-
LY_CHECK_ARG_RET(ctx, ctx, value, ctx_node, path, err, LY_EINVAL);
842+
LY_CHECK_ARG_RET(ctx, ctx, value, path, err, LY_EINVAL);
842843

843844
*path = NULL;
844845
*err = NULL;
@@ -877,8 +878,8 @@ lyplg_type_lypath_new(const struct ly_ctx *ctx, const char *value, size_t value_
877878
}
878879

879880
/* resolve it on schema tree */
880-
ret = ly_path_compile(ctx, NULL, ctx_node, NULL, exp, (ctx_node->flags & LYS_IS_OUTPUT) ?
881-
LY_PATH_OPER_OUTPUT : LY_PATH_OPER_INPUT, LY_PATH_TARGET_SINGLE, 1, format, prefix_data, path);
881+
oper = (ctx_node && (ctx_node->flags & LYS_IS_OUTPUT)) ? LY_PATH_OPER_OUTPUT : LY_PATH_OPER_INPUT;
882+
ret = ly_path_compile(ctx, NULL, ctx_node, NULL, exp, oper, LY_PATH_TARGET_SINGLE, 1, format, prefix_data, path);
882883
if (ret) {
883884
err_fmt = "Invalid instance-identifier \"%.*s\" value - semantic error%s%s";
884885
goto cleanup;

0 commit comments

Comments
 (0)