Fixed #141 list index out of range
If the number of events exceeded the number of lines allocated for events, a *list index out of range* exception was thrown. This has been fixed now by providing an additional check.
This commit is contained in:
		| @@ -297,9 +297,11 @@ class Calendar(inkycal_module): | |||||||
|  |  | ||||||
|         cursor = 0 |         cursor = 0 | ||||||
|         for event in upcoming_events: |         for event in upcoming_events: | ||||||
|  |           if cursor < len(event_lines): | ||||||
|             name = event['title'] |             name = event['title'] | ||||||
|             date = event['begin'].format(self.date_format, locale=lang) |             date = event['begin'].format(self.date_format, locale=lang) | ||||||
|             time = event['begin'].format(self.time_format, locale=lang) |             time = event['begin'].format(self.time_format, locale=lang) | ||||||
|  |             #logger.debug(f"name:{name}   date:{date} time:{time}") | ||||||
|  |  | ||||||
|             if now < event['end']: |             if now < event['end']: | ||||||
|               write(im_colour, event_lines[cursor], (date_width, line_height), |               write(im_colour, event_lines[cursor], (date_width, line_height), | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user