aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
Diffstat (limited to 'server')
-rw-r--r--server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java
index 94fbef613d..5c074d774c 100644
--- a/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java
+++ b/server/src/main/java/com/vaadin/ui/renderers/TextRenderer.java
@@ -52,9 +52,12 @@ public class TextRenderer extends AbstractRenderer<Object, Object> {
public JsonValue encode(Object value) {
if (value == null) {
return super.encode(null);
- } else {
- return Json.create(value.toString());
}
+ String stringValue = value.toString();
+ if (stringValue == null) {
+ return super.encode(null);
+ }
+ return Json.create(stringValue);
}
@Override