Prevent loading from cache if commit is nil

This commit is contained in:
Heinrich Lee Yu 2018-11-23 09:30:15 +08:00
parent 5f11daf63c
commit 3b49a7948c
No known key found for this signature in database
GPG Key ID: 6EDB5D452716DE6B
1 changed files with 1 additions and 2 deletions

View File

@ -47,6 +47,7 @@ module Gitlab
def load_status
return if loaded?
return unless commit
if has_cache?
load_from_cache
@ -59,8 +60,6 @@ module Gitlab
end
def load_from_project
return unless commit
self.sha, self.status, self.ref = commit.sha, commit.status, project.default_branch
end