check if todo data entry exists to prevent errors when writing text (text=None)
This commit is contained in:
		| @@ -159,6 +159,7 @@ class Todoist(inkycal_module): | |||||||
|                     if cursor < len(line_positions): |                     if cursor < len(line_positions): | ||||||
|                         line_x, line_y = line_positions[cursor] |                         line_x, line_y = line_positions[cursor] | ||||||
|  |  | ||||||
|  |                         if todo['project']: | ||||||
|                             # Add todos project name |                             # Add todos project name | ||||||
|                             write( |                             write( | ||||||
|                                 im_colour, line_positions[cursor], |                                 im_colour, line_positions[cursor], | ||||||
| @@ -166,13 +167,14 @@ class Todoist(inkycal_module): | |||||||
|                                 todo['project'], font=self.font, alignment='left') |                                 todo['project'], font=self.font, alignment='left') | ||||||
|  |  | ||||||
|                         # Add todos due if not empty |                         # Add todos due if not empty | ||||||
|                         if todo['due'] != "": |                         if todo['due']: | ||||||
|                             write( |                             write( | ||||||
|                                 im_black, |                                 im_black, | ||||||
|                                 (line_x + project_width, line_y), |                                 (line_x + project_width, line_y), | ||||||
|                                 (due_width, line_height), |                                 (due_width, line_height), | ||||||
|                                 todo['due'], font=self.font, alignment='left') |                                 todo['due'], font=self.font, alignment='left') | ||||||
|  |  | ||||||
|  |                         if todo['name']: | ||||||
|                             # Add todos name |                             # Add todos name | ||||||
|                             write( |                             write( | ||||||
|                                 im_black, |                                 im_black, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user