Skip to content

Commit c79c236

Browse files
author
graeme
committed
fix for GRAILS-1097
git-svn-id: https://svn.codehaus.org/grails/trunk@4112 1cfb16fd-6d17-0410-8ff1-b7e8e1e2867d
1 parent b427eb6 commit c79c236

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/web/org/codehaus/groovy/grails/web/taglib/GroovyPageTagWriter.java

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
import java.io.StringWriter;
1919

2020
/**
21-
* A temporary writer used by GSP to write to a StringWriter and later retrieve the value
21+
* A temporary writer used by GSP to write to a StringWriter and later retrieve the value. It also converts
22+
* nulls into blank strings.
2223
*
2324
* @author Graeme Rocher
24-
* @since 0.4
25+
* @since 0.5
26+
*
2527
* <p/>
2628
* Created: Apr 19, 2007
2729
* Time: 5:49:46 PM
@@ -50,6 +52,20 @@ public void print(Object o) {
5052
super.print(o);
5153
}
5254

55+
public void write(String s) {
56+
if(s == null) s = BLANK_STRING;
57+
super.write(s);
58+
}
59+
60+
public void println(String s) {
61+
if(s == null) s = BLANK_STRING;
62+
super.println(s);
63+
}
64+
65+
public void println(Object o) {
66+
if(o==null)o = BLANK_STRING;
67+
super.println(o);
68+
}
5369
public String getValue() {
5470
return stringWriter.toString();
5571
}

0 commit comments

Comments
 (0)