Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
dont call artifacts on nil (#1107)
Browse files Browse the repository at this point in the history
  • Loading branch information
snatchev committed Jul 26, 2018
1 parent bd624f7 commit 1da1f72
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions app/features-json/build_json_controller.rb
Expand Up @@ -97,20 +97,22 @@ def self.build_url(project_id:, build_number:)
current_project = FastlaneCI::Services.project_service.project_by_id(project_id)
current_build = current_project.builds.find { |b| b.number == build_number.to_i }

build_log_artifact = current_build.artifacts.find do |current_artifact|
# We can improve the detection in the future, to actually mark an artifact as "default output"
current_artifact.type.include?("log") && current_artifact.reference.end_with?("runner.log")
end
if current_build
build_log_artifact = current_build.artifacts.find do |current_artifact|
# We can improve the detection in the future, to actually mark an artifact as "default output"
current_artifact.type.include?("log") && current_artifact.reference.end_with?("runner.log")
end

if build_log_artifact
logger.debug("streaming back artifact: #{build_log_artifact.reference}")
File.open(build_log_artifact.reference, "r") do |file|
file.each_line do |line|
ws.send(convert_ansi_to_plain_text(line.chomp))
if build_log_artifact
logger.debug("streaming back artifact: #{build_log_artifact.reference}")
File.open(build_log_artifact.reference, "r") do |file|
file.each_line do |line|
ws.send(convert_ansi_to_plain_text(line.chomp))
end
end
ws.close(1000, "runner complete.")
next
end
ws.close(1000, "runner complete.")
next
end

## if we have no runner.log, then check to see if the build_runner is still working.
Expand Down

0 comments on commit 1da1f72

Please sign in to comment.