diff options
Diffstat (limited to 'lib/gitlab/ci/trace/stream.rb')
-rw-r--r-- | lib/gitlab/ci/trace/stream.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/gitlab/ci/trace/stream.rb b/lib/gitlab/ci/trace/stream.rb index 2af94e2c60e..41dcf846fed 100644 --- a/lib/gitlab/ci/trace/stream.rb +++ b/lib/gitlab/ci/trace/stream.rb @@ -76,11 +76,14 @@ module Gitlab stream.each_line do |line| matches = line.scan(regex) next unless matches.is_a?(Array) + next if matches.empty? match = matches.flatten.last coverage = match.gsub(/\d+(\.\d+)?/).first - return coverage.to_f if coverage.present? + return coverage if coverage.present? end + + nil rescue # if bad regex or something goes wrong we dont want to interrupt transition # so we just silentrly ignore error for now |