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

fix bad interaction of null with value classes #106

Merged
merged 1 commit into from
Apr 21, 2014
Merged

Conversation

dwhjames
Copy link
Owner

db.entity and db.entid both return null if given a lookup ref that does not resolve.

Constructing the Entity value class from the return value of a method that can return null causes problems. And also, null.asInstanceOf[Long] == 0. This fix tests for nulls and throws exceptions.

To be able to test for lookup ref resolution without needing to trap exceptions, helper methods are added to the lookup ref class that return Option.

db.entity and db.entid both return null if given a lookup ref that does not resolve.

Constructing the Entity value class from the return value of a method that can return null causes problems. And also, null.asInstanceOf[Long] == 0. This fix tests for nulls and throws exceptions.

To be able to test for lookup ref resolution without needing to trap exceptions, helper methods are added to the lookup ref class that return Option.
@dwhjames dwhjames added this to the v0.7 milestone Apr 21, 2014
dwhjames added a commit that referenced this pull request Apr 21, 2014
fix bad interaction of null with value classes
@dwhjames dwhjames merged commit e3335d2 into develop Apr 21, 2014
@dwhjames dwhjames deleted the fix/nulls branch April 21, 2014 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant