Skip to content

Commit

Permalink
ensure due_date exists before applying classes
Browse files Browse the repository at this point in the history
  • Loading branch information
MattBudz committed Aug 12, 2024
1 parent 428d648 commit 9e705ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/tasks/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<% elsif task.due_date == Date.tomorrow %>
<span class="due-tomorrow">Tomorrow</span>
<% else %>
<span class="<%= task.due_date < Date.today ? 'due-overdue' : 'due-later' %>">
<span class="<%= task.due_date && task.due_date < Date.today ? 'due-overdue' : 'due-later' %>">
<%= task&.due_date&.strftime('%b %e') %>
</span>
<% end %>
Expand Down

0 comments on commit 9e705ec

Please sign in to comment.