diff MAINTENANCE return check
diff --git a/src/diff.c b/src/diff.c
index d0ee123..e69f52a 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -1374,7 +1374,7 @@
     assert(mod);
 
     /* get node operation */
-    lyd_diff_get_op(diff, &op);
+    LY_CHECK_RET(lyd_diff_get_op(diff, &op), 0);
 
     if ((op == LYD_DIFF_OP_REPLACE) && lysc_is_userordered(diff->schema)) {
         /* check for redundant move */