Prevent 500 if data[:commits] is nil for event

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2013-11-25 17:59:12 +02:00
parent 4cb17deec1
commit 8b9bbeeba2
No known key found for this signature in database
GPG key ID: 2CEAFD2671262EC2

View file

@ -223,7 +223,7 @@ class Event < ActiveRecord::Base
# Max 20 commits from push DESC
def commits
@commits ||= data[:commits].reverse
@commits ||= (data[:commits] || []).reverse
end
def commits_count