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 VoltTime comparison with nil issue #345

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

matthew342
Copy link
Contributor

Setting a model attribute that contains a VoltTime to nil raises 'undefined method `getutc' for nil:NilClass' when volt/models/model.rb:213 tries to compare the new (nil) value to the old value.

Example stacktrace:

NoMethodError:
       undefined method `getutc' for nil:NilClass
     # /Users/Matt/.rvm/gems/ruby-2.3.0@volt/bundler/gems/volt-f942b92385ad/lib/volt/helpers/time/volt_time.rb:97:in `=='
     # /Users/Matt/.rvm/gems/ruby-2.3.0@volt/bundler/gems/volt-f942b92385ad/lib/volt/models/model.rb:213:in `!='
     # /Users/Matt/.rvm/gems/ruby-2.3.0@volt/bundler/gems/volt-f942b92385ad/lib/volt/models/model.rb:213:in `set'
     # /Users/Matt/.rvm/gems/ruby-2.3.0@volt/bundler/gems/volt-f942b92385ad/lib/volt/models/field_helpers.rb:90:in `block in field'

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.

None yet

2 participants