Commit dec4e89e authored by Rémy Coutable's avatar Rémy Coutable 🔴

In UsersController#calendar_activities, when Date isn't parsable, fallback to

For some reason, GoogleBot accesses /u/:username/calendar_activities without
a :date param, but then the view was trying to call #to_s(:short) which
doesn't exist on nil, leading to the following Sentry report:
parent 7e710acc
Pipeline #753039 failed with stage
......@@ -67,12 +67,8 @@ class UsersController < ApplicationController
def calendar_activities
@calendar_date = Date.parse(params[:date]) rescue nil
@events = []
if @calendar_date
@events = contributions_calendar.events_by_date(@calendar_date)
@calendar_date = Date.parse(params[:date]) rescue
@events = contributions_calendar.events_by_date(@calendar_date)
render 'calendar_activities', layout: false
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment