Skip to content

Commit 9656b2d

Browse files
authored
id is null when the entity has no records (#18)
1 parent 7e1770b commit 9656b2d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

srv/src/main/java/customer/bookstore/AdminHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ void genId(EventContext ctx) {
4646
case DraftNewEventContext newCtx -> newCtx.getCqn().entries();
4747
default -> List.of();
4848
};
49-
entries.forEach(m -> m.put("ID", id + 4)); // Note: that is not safe! ok for this sample only.
49+
entries.forEach(m -> m.put("ID", id != null ? id + 4 : 0 )); // Note: that is not safe! ok for this sample only.
5050
}
5151
}

0 commit comments

Comments
 (0)