Fix the error when start_at or end_at is nil

This commit is contained in:
Eugene Burmakin 2024-03-16 22:48:26 +01:00
parent 476701c5df
commit bb528b429b

View file

@ -2,8 +2,8 @@ class PointsController < ApplicationController
before_action :authenticate_user!
def index
start_at = params[:start_at].to_datetime.to_i
end_at = params[:end_at].to_datetime.to_i
start_at = params[:start_at]&.to_datetime.to_i
end_at = params[:end_at]&.to_datetime.to_i
@points =
if start_at && end_at