aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2017-07-19 09:34:05 +0300
committerHenri Sara <henri.sara@gmail.com>2017-07-19 09:34:05 +0300
commite8f7de722a7561e25c6bfd1fb007f498db22b1c7 (patch)
treeb66b761eea0c5386f4c8c0112e278f140e08ce6d /server
parentce566c57fa7a020d654b9bdc7c885f8874148aa1 (diff)
downloadvaadin-framework-e8f7de722a7561e25c6bfd1fb007f498db22b1c7.tar.gz
vaadin-framework-e8f7de722a7561e25c6bfd1fb007f498db22b1c7.zip
Allow null Components in ComponentRenderer (#9692)8.1.0.rc2
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/ui/renderers/ComponentRenderer.java7
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