Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pojos.Items.cndAuto 如果主键值为空,空指针 #733

Closed
ming300 opened this issue Oct 1, 2014 · 1 comment
Closed

Pojos.Items.cndAuto 如果主键值为空,空指针 #733

ming300 opened this issue Oct 1, 2014 · 1 comment
Assignees
Milestone

Comments

@ming300
Copy link
Member

ming300 commented Oct 1, 2014

版本 1.b.50

如果主键字段的值为null,执行update操作,会空指针.

org.nutz.dao.util.Pojos.Items.cndAuto(Entity<?>, Object)

        case NAME:
            String name = null != obj ? en.getNameField().getValue(obj).toString() : null;

java.lang.NullPointerException
at org.nutz.dao.util.Pojos$Items.cndAuto(Pojos.java:130)
at org.nutz.dao.impl.EntityOperator.addUpdate(EntityOperator.java:74)
at org.nutz.dao.impl.EntityOperator.addUpdate(EntityOperator.java:56)
at org.nutz.dao.impl.NutDao.update(NutDao.java:219)

@wendal
Copy link
Member

wendal commented Oct 2, 2014

嗯嗯,应该主动抛出异常

@wendal wendal added this to the 1.b.51 milestone Oct 2, 2014
@wendal wendal self-assigned this Oct 2, 2014
@wendal wendal closed this as completed in 13ad5ef Oct 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants