schema compile BUGFIX prevent when unres without a node
diff --git a/src/schema_compile.c b/src/schema_compile.c
index 83851bf..2aecc02 100644
--- a/src/schema_compile.c
+++ b/src/schema_compile.c
@@ -1299,11 +1299,9 @@
         w = ds_unres->whens.objs[i];
         LYSC_CTX_INIT_PMOD(cctx, w->node->module->parsed, NULL);
 
-        if (w->node) {
-            LOG_LOCSET(w->node, NULL);
-        }
+        LOG_LOCSET(w->node, NULL);
         ret = lys_compile_unres_when(&cctx, w->when, w->node);
-        LOG_LOCBACK(w->node ? 1 : 0, 0);
+        LOG_LOCBACK(1, 0);
         LY_CHECK_GOTO(ret, cleanup);
 
         free(w);