tree data UPDATE always log invalid value schema
diff --git a/src/tree_data_common.c b/src/tree_data_common.c
index f732cd2..930e90c 100644
--- a/src/tree_data_common.c
+++ b/src/tree_data_common.c
@@ -472,9 +472,18 @@
     } else if (rc && err) {
         if (ctx) {
             /* log only in case the ctx was provided as input parameter */
-            LOG_LOCSET(NULL, NULL, err->path, NULL);
+            if (err->path) {
+                LOG_LOCSET(NULL, NULL, err->path, NULL);
+            } else {
+                /* use at least the schema path */
+                LOG_LOCSET(node, NULL, NULL, NULL);
+            }
             LOGVAL_ERRITEM(ctx, err);
-            LOG_LOCBACK(0, 0, 1, 0);
+            if (err->path) {
+                LOG_LOCBACK(0, 0, 1, 0);
+            } else {
+                LOG_LOCBACK(1, 0, 0, 0);
+            }
         }
         ly_err_free(err);
     }