Skip to content

Commit

Permalink
[frontend] Fix undefined method `to_datetime' for nil:NilClass
Browse files Browse the repository at this point in the history
When a binary doesn't have a buildtime OBS was causing an exception,
because we were not handling this case.
This Fixes the issue.

Fixes #5045
  • Loading branch information
bgeuken committed Jun 19, 2018
1 parent 536e6dc commit 6a3d798
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/api/app/models/binary_release.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@ def reset_cache
def indentical_to?(binary_hash)
binary_disturl == binary_hash['disturl'] &&
binary_supportstatus == binary_hash['supportstatus'] &&
entry.binary_buildtime.to_datetime.utc == ::Time.at(binary['buildtime'].to_i).to_datetime.utc
binary_buildtime &&
binary_buildtimeto.datetime.utc == ::Time.at(binary['buildtime'].to_i).to_datetime.utc
end
#### Alias of methods
end
Expand Down

0 comments on commit 6a3d798

Please sign in to comment.