We were suprised to catch this one in production:
crud.addEditListener(
e -> {
e.getItem().getId();//e.getItem returns null
}
});
Cannot invoke "myModel.getId()" because the return value of "com.vaadin.flow.component.crud.Crud$EditEvent.getItem()" is null
In EditEvent, nothing says that E item
can be null. Is this an obscure bug we’ve hit? Or there are legitimate cases where item can be null? It’s not a multi-user scenario, only one user at the time can edit items in that crud.