Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Don't crash on empty versions

  • Loading branch information...
commit 5b94977f42f6db6f3e650c345fcdcb0333ea0a07 1 parent 1c4a46b
@vmg vmg authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 app/models/library.rb
View
5 app/models/library.rb
@@ -5,6 +5,9 @@ def self.collection
end
def self.versions
- collection.find('_id' => 'versions').first['numbers']
+ @@versions ||= begin
+ col = collection.find('_id' => 'versions').first
+ col ? col['numbers'] : []
+ end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.