浏览代码

jfinal 3.5

James 7 年之前
父节点
当前提交
5f582f5ac6
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      src/main/java/com/jfinal/template/expr/ast/Compare.java

+ 4 - 0
src/main/java/com/jfinal/template/expr/ast/Compare.java

@@ -134,6 +134,7 @@ public class Compare extends Expr {
 		}
 		
 		if (leftValue instanceof Comparable &&
+			rightValue != null &&
 			leftValue.getClass() == rightValue.getClass()) {
 			return ((Comparable)leftValue).compareTo((Comparable)rightValue) > 0;
 		}
@@ -166,6 +167,7 @@ public class Compare extends Expr {
 		}
 		
 		if (leftValue instanceof Comparable &&
+			rightValue != null &&
 			leftValue.getClass() == rightValue.getClass()) {
 			return ((Comparable)leftValue).compareTo((Comparable)rightValue) >= 0;
 		}
@@ -198,6 +200,7 @@ public class Compare extends Expr {
 		}
 		
 		if (leftValue instanceof Comparable &&
+			rightValue != null &&
 			leftValue.getClass() == rightValue.getClass()) {
 			return ((Comparable)leftValue).compareTo((Comparable)rightValue) < 0;
 		}
@@ -230,6 +233,7 @@ public class Compare extends Expr {
 		}
 		
 		if (leftValue instanceof Comparable &&
+			rightValue != null &&
 			leftValue.getClass() == rightValue.getClass()) {
 			return ((Comparable)leftValue).compareTo((Comparable)rightValue) <= 0;
 		}