diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java index f5dd507cff..0f8ca4401d 100644 --- a/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java +++ b/server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java @@ -38,10 +38,11 @@ import elemental.json.JsonValue; * instances. * <p> * Example of how to add a {@link Label} component to {@link Grid}: + * * <pre> * Grid<Person> grid; - * grid.addColumn(person -> new Label(person.getFullName()), - * new ComponentRenderer()).setCaption("Full Name"); + * grid.addColumn(person -> new Label(person.getFullName()), + * new ComponentRenderer()).setCaption("Full Name"); * </pre> * * @author Vaadin Ltd @@ -59,7 +60,7 @@ public class ComponentRenderer extends AbstractRenderer<Object, Component> { @Override public JsonValue encode(Component value) { - return Json.create(value.getConnectorId()); + return value != null ? Json.create(value.getConnectorId()) : null; } @Override |