ソースを参照

hasColumnLable 添加 null key 判断,支持 TreeMap

James 3 年 前
コミット
67d6c83708
1 ファイル変更2 行追加1 行削除
  1. 2 1
      src/main/java/com/jfinal/plugin/activerecord/Table.java

+ 2 - 1
src/main/java/com/jfinal/plugin/activerecord/Table.java

@@ -87,7 +87,8 @@ public class Table {
 	 * Think about auto saving the related table's column in the future.
 	 */
 	public boolean hasColumnLabel(String columnLabel) {
-		return columnTypeMap.containsKey(columnLabel);
+	    // TreeMap.containsKey(...) 不允许参数为 null,故需添加 null 值判断
+		return columnLabel != null && columnTypeMap.containsKey(columnLabel);
 	}
 	
 	/**