Making version comparison more error-resilient
This commit is contained in:
parent
29867287a5
commit
8137dc788d
1 changed files with 2 additions and 2 deletions
|
|
@ -71,8 +71,8 @@ class Package < ActiveRecord::Base
|
|||
private
|
||||
|
||||
def version_compare(x,y)
|
||||
x ||= '0'
|
||||
y ||= '0'
|
||||
x = '0' unless x.present?
|
||||
y = '0' unless y.present?
|
||||
version_x = DebImporter::Version.new(x)
|
||||
version_y = DebImporter::Version.new(y)
|
||||
if version_x<version_y
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue