Skip to content

Commit

Permalink
Don't break snippet creation when Puzzle does not exist (#734)
Browse files Browse the repository at this point in the history
  • Loading branch information
pil0u authored Dec 13, 2024
1 parent 2f7d963 commit a24d843
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/snippets_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def client

def update_slack_thread
puzzle = Puzzle.by_date(Aoc.begin_time.change(day: params[:day]))
return if puzzle.thread_ts.nil?
return if puzzle&.thread_ts.nil?

snippets = Snippet.includes(:user).where(day: @snippet.day)
part_one, part_two = snippets.partition { |snippet| snippet.challenge == 1 }.map do |solutions|
Expand Down

0 comments on commit a24d843

Please sign in to comment.