Resolve bug in event list

Add a condition to prevent a template bug when there are no events.