浏览代码

Merge branch 'master' into jfinal-java8

James 7 年之前
父节点
当前提交
7851a88c3f
共有 1 个文件被更改,包括 8 次插入0 次删除
  1. 8 0
      src/main/java/com/jfinal/template/stat/ast/Text.java

+ 8 - 0
src/main/java/com/jfinal/template/stat/ast/Text.java

@@ -67,6 +67,10 @@ public class Text extends Stat implements IWritable {
 			}
 		}
 		
+		if (bytes != null) {
+			return bytes;
+		}
+		
 		bytes = new String(chars).getBytes(charset);
 		return bytes;
 	}
@@ -88,6 +92,10 @@ public class Text extends Stat implements IWritable {
 			}
 		}
 		
+		if (chars != null) {
+			return chars;
+		}
+		
 		String strTemp = new String(bytes, charset);
 		char[] charsTemp = new char[strTemp.length()];
 		strTemp.getChars(0, strTemp.length(), charsTemp, 0);