Skip to content

Commit

Permalink
Add a guard for unknown file programs
Browse files Browse the repository at this point in the history
  • Loading branch information
glacials committed Feb 8, 2025
1 parent 22506b5 commit c2c8ed7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/controllers/api/v3/runs_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ def create
body: params.require(:file)
)
$s3_shutdown_prep_bucket.put_object(
key: @run.id,
key: "#{@run.id}",
body: filename,
)
$s3_shutdown_prep_bucket.put_object(
key: "extensions/#{@run.id}",
body: Run.program(@run.program).file_extension,
)
if program = Run.program(@run.program)
$s3_shutdown_prep_bucket.put_object(
key: "extensions/#{@run.id}",
body: program.file_extension,
)
end

render status: :created, location: api_v3_run_url(@run), json: {
status: 201,
Expand Down

0 comments on commit c2c8ed7

Please sign in to comment.