Skip to content

Commit

Permalink
Added empty list fallback if variables are not declared
Browse files Browse the repository at this point in the history
  • Loading branch information
thvmulle committed Oct 24, 2024
1 parent beede98 commit 0429933
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/views/courses/questions.json.jbuilder
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
json.unanswered do
json.array! @unanswered, partial: 'annotations/annotation', as: :annotation
json.array! @unanswered || [], partial: 'annotations/annotation', as: :annotation
end

json.in_progress do
json.array! @in_progress, partial: 'annotations/annotation', as: :annotation
json.array! @in_progress || [], partial: 'annotations/annotation', as: :annotation
end

json.answered do
json.array! @answered, partial: 'annotations/annotation', as: :annotation
json.array! @answered || [], partial: 'annotations/annotation', as: :annotation
end

0 comments on commit 0429933

Please sign in to comment.