Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix bug in SCB that lost encoding information

  • Loading branch information...
commit 71baa748745de16a656d555c2250237ffec9ca0c 1 parent 777fb7d
@lhotari lhotari authored
View
28 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/util/StreamCharBuffer.java
@@ -576,20 +576,20 @@ public void writeTo(Writer target, boolean flushTarget, boolean emptyAfter) thro
} else if (target instanceof EncodedAppenderFactory) {
EncodedAppenderFactory eaw=(EncodedAppenderFactory)target;
EncodedAppender appender = eaw.getEncodedAppender();
- if (appender == writer.getEncodedAppender()) {
- throw new IllegalArgumentException("Cannot write buffer to itself.");
- }
- Encoder encoder=null;
-
- if (target instanceof EncoderAware) {
- encoder = ((EncoderAware)target).getEncoder();
- }
-
- if (encoder == null && appender instanceof EncoderAware) {
- encoder = ((EncoderAware)appender).getEncoder();
- }
-
- if (encoder != null) {
+ if(appender != null) {
+ if (appender == writer.getEncodedAppender()) {
+ throw new IllegalArgumentException("Cannot write buffer to itself.");
+ }
+ Encoder encoder=null;
+
+ if (target instanceof EncoderAware) {
+ encoder = ((EncoderAware)target).getEncoder();
+ }
+
+ if (encoder == null && appender instanceof EncoderAware) {
+ encoder = ((EncoderAware)appender).getEncoder();
+ }
+
encodeTo(appender, encoder);
if (emptyAfter) {
emptyAfterReading();
Please sign in to comment.
Something went wrong with that request. Please try again.