aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorPeter Wilmott <p@p8952.info>2015-04-14 23:35:41 +0100
committerPeter Wilmott <p@p8952.info>2015-04-14 23:35:41 +0100
commitdb9012b6da892d74058ae2249f209b52bbafd36a (patch)
tree49f554ad58924ea6a85264699d3207932b44724f /web
parentTypo (diff)
downloadruby-tinderbox-db9012b6da892d74058ae2249f209b52bbafd36a.tar.gz
ruby-tinderbox-db9012b6da892d74058ae2249f209b52bbafd36a.tar.bz2
ruby-tinderbox-db9012b6da892d74058ae2249f209b52bbafd36a.zip
Ensure the package exists before trying to add a repoman log to it, as it done with builds
Diffstat (limited to 'web')
-rw-r--r--web/lib/ci.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/web/lib/ci.rb b/web/lib/ci.rb
index d3d3d31..80de8fb 100644
--- a/web/lib/ci.rb
+++ b/web/lib/ci.rb
@@ -147,14 +147,17 @@ def update_repoman
result = 'failed'
end
- Package.where(sha1: sha1).first.add_repoman(
- Repoman.find_or_create(
- timestamp: timestamp,
- target: target,
- result: result,
- log: log
+ package = Package.where(sha1: sha1).first
+ unless package.nil?
+ package.add_repoman(
+ Repoman.find_or_create(
+ timestamp: timestamp,
+ target: target,
+ result: result,
+ log: log
+ )
)
- )
+ end
rescue => e
puts "ERROR: #{e}"
next