Skip to content

Commit 5a68772

Browse files
committed
Add one more guard
1 parent 7f056b4 commit 5a68772

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/controllers/podcast_metrics_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ def metrics_params
219219
end
220220

221221
def calculate_episode_trend(episode, prev_episode)
222-
return nil unless episode.in_default_feed? && prev_episode.present?
222+
return nil unless episode.in_default_feed? && episode.first_rss_published_at.present? && prev_episode.present?
223223
return nil if (episode.first_rss_published_at + 1.day) > Time.now
224224

225225
ep_dropday_sum = episode_dropday_query(episode)

0 commit comments

Comments
 (0)