Fix an exception thrown when no date is selected