diff options
-rw-r--r-- | src/day.c | 8 | ||||
-rw-r--r-- | src/ui-todo.c | 5 |
2 files changed, 13 insertions, 0 deletions
@@ -634,6 +634,10 @@ void day_popup_item(struct day_item *day) asprintf(¬epath, "%s%s", path_notes, day_item_get_note(day)); fp = fopen(notepath, "r"); + if (fp == NULL) { + item_in_popup(NULL, NULL, day_item_get_mesg(day), _("Event:")); + return; + } note_read_contents(note, note_size, fp); fclose(fp); mem_free(notepath); @@ -661,6 +665,10 @@ void day_popup_item(struct day_item *day) asprintf(¬epath, "%s%s", path_notes, day_item_get_note(day)); fp = fopen(notepath, "r"); + if (fp == NULL) { + item_in_popup(a_st, a_end, day_item_get_mesg(day), _("Appointment:")); + return; + } note_read_contents(note, note_size, fp); fclose(fp); mem_free(notepath); diff --git a/src/ui-todo.c b/src/ui-todo.c index b65b8d3..6fdd08f 100644 --- a/src/ui-todo.c +++ b/src/ui-todo.c @@ -327,6 +327,11 @@ void ui_todo_popup_item(void) asprintf(¬epath, "%s%s", path_notes, item->note); fp = fopen(notepath, "r"); + if (fp == NULL) { + item_in_popup(NULL, NULL, item->mesg, _("TODO:")); + return; + } + note_read_contents(note, note_size, fp); fclose(fp); mem_free(notepath); |