From e8f7de722a7561e25c6bfd1fb007f498db22b1c7 Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Wed, 19 Jul 2017 09:34:05 +0300 Subject: Allow null Components in ComponentRenderer (#9692) --- .../src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'server') 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. *

* Example of how to add a {@link Label} component to {@link Grid}: + * *

  * Grid 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");
  * 
* * @author Vaadin Ltd @@ -59,7 +60,7 @@ public class ComponentRenderer extends AbstractRenderer { @Override public JsonValue encode(Component value) { - return Json.create(value.getConnectorId()); + return value != null ? Json.create(value.getConnectorId()) : null; } @Override -- cgit v1.2.3