Do not crash when sorting screenshots by version if the version is empty

This commit is contained in:
Christoph Haas 2016-06-24 16:19:05 +02:00
parent 9603550aab
commit bac90cbd2f

View file

@ -65,6 +65,8 @@ class Package < ActiveRecord::Base
private
def version_compare(x,y)
x ||= '0'
y ||= '0'
version_x = DebImporter::Version.new(x)
version_y = DebImporter::Version.new(y)
if version_x<version_y