summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2016-04-06 23:07:12 -0700
committerStan Hu <stanhu@gmail.com>2016-04-06 23:19:21 -0700
commit31210cb6cb0ae723647e07ae8454cb3df22ad3ef (patch)
treed8f11a2291461f95a9a1dd0b89c44e8bedf4f16d
parent8f0945311b8f5fe30b0b57739ee9f3262499f375 (diff)
downloadgitlab-ce-handle-nil-ci-id.tar.gz
Handle an undefined ci_id: this was keeping projects from being destroyedhandle-nil-ci-id
Closes #15005
-rw-r--r--app/models/ci/build.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/ci/build.rb b/app/models/ci/build.rb
index 7d33838044b..debb7eeded7 100644
--- a/app/models/ci/build.rb
+++ b/app/models/ci/build.rb
@@ -285,6 +285,8 @@ module Ci
# This method returns old path to artifacts only if it already exists.
#
def artifacts_path
+ return unless project
+
old = File.join(created_at.utc.strftime('%Y_%m'),
project.ci_id.to_s,
id.to_s)