Skip to content

Commit

Permalink
fix nutzam#530 : 当关联字段是一个集合且包含null的话, 中途会报错 --> 改为提前报错
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed Oct 14, 2013
1 parent 4b98e8a commit 89424f9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/org/nutz/dao/impl/link/DoInsertLinkVisitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public Object invoke(Connection conn, ResultSet rs, Pojo pojo) throws SQLExcepti
final Entity<?> en = lnk.getLinkedEntity();
Lang.each(value, new Each<Object>() {
public void invoke(int i, Object ele, int length) throws ExitLoop, LoopException {
if (ele == null)
throw new NullPointerException("null ele in linked field!!");
// 执行插入
opt.addInsert(en, ele);
// 更新字段
Expand Down

0 comments on commit 89424f9

Please sign in to comment.