Browse Source

构造方法添加 && content != null

James 4 years ago
parent
commit
b56221bd49
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/main/java/com/jfinal/template/source/StringSource.java

+ 1 - 1
src/main/java/com/jfinal/template/source/StringSource.java

@@ -51,7 +51,7 @@ public class StringSource implements ISource {
 	}
 	
 	public StringSource(StringBuilder content, boolean cache) {
-		this(content, cache ? HashKit.md5(content.toString()) : null);
+		this(content, cache && content != null ? HashKit.md5(content.toString()) : null);
 	}
 	
 	public StringSource(StringBuilder content, String cacheKey) {