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

nilllable Time type fails declared as Time? #64

Open
fridgerator opened this issue Dec 13, 2016 · 0 comments
Open

nilllable Time type fails declared as Time? #64

fridgerator opened this issue Dec 13, 2016 · 0 comments

Comments

@fridgerator
Copy link

class created like:

class User
  DB.mapping({
    id: Int32?, 
    name: String?,
    some_date: Time?
  })
end

If a record is inserted into the database with a nil column value for some_date, then trying to call User.from_rs(result_set) fails with an error:

Nil assertion failed (Exception)
0x10158ec62: *CallStack::unwind:Array(Pointer(Void)) at ??
0x10158ec01: *CallStack#initialize:Array(Pointer(Void)) at ??
0x10158ebd8: *CallStack::new:CallStack at ??
0x10157b4d1: *raise<Exception>:NoReturn at ??
0x10157b4b1: *raise<String>:NoReturn at ??
0x1015adb93: *Nil#not_nil!:NoReturn at ??
0x10163b935: *User#initialize<PG::ResultSet>:Time at ??
0x10163b539: *User::new<PG::ResultSet>:User at ??
0x10163b4ad: *User::from_rs<PG::ResultSet>:Array(User) at ??
0x10157b068: __crystal_main at ??
0x101589af8: main at ??
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

No branches or pull requests

1 participant