<div class="post">
<ul class="container">
- <% @items.group_by { |item| item.respond_to?(:published_at) ? item.published_at.to_date : item.created_at.to_date }.each do |date, items| %>
+ <% @items.group_by { |item| item.respond_to?(:published_at) ? item.published_at&.to_date : item.created_at.to_date }.each do |date, items| %>
<li class="date-heading">
- From <%= date.strftime('%B %e, %Y') %>:
+ From <%= date&.strftime('%B %e, %Y') %>:
</li>
<% items.each do |item| %>
<li class="<%= item.post_type %>-item<%= if item.short_dispatch? then " thought-item" end %>">