fix cursor out of range
This commit is contained in:
		| @@ -163,8 +163,9 @@ class Todoist(inkycal_module): | |||||||
|     # Add the parsed todos on the image |     # Add the parsed todos on the image | ||||||
|     cursor = 0 |     cursor = 0 | ||||||
|     for name, todos in grouped.items(): |     for name, todos in grouped.items(): | ||||||
|       if todos != []: |       if todos: | ||||||
|         for todo in todos: |         for todo in todos: | ||||||
|  |           if cursor < len(line_positions): | ||||||
|             line_x, line_y = line_positions[cursor] |             line_x, line_y = line_positions[cursor] | ||||||
|  |  | ||||||
|             # Add todo project name |             # Add todo project name | ||||||
| @@ -189,7 +190,7 @@ class Todoist(inkycal_module): | |||||||
|               todo['name'], font=self.font, alignment='left') |               todo['name'], font=self.font, alignment='left') | ||||||
|  |  | ||||||
|             cursor += 1 |             cursor += 1 | ||||||
|           if cursor > max_lines: |         else: | ||||||
|           logger.error('More todos than available lines') |           logger.error('More todos than available lines') | ||||||
|           break |           break | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user