From fc6fe42337445b2fa211f85dbf72868b3ce8f4e6 Mon Sep 17 00:00:00 2001 From: anon Date: Thu, 3 Aug 2023 16:08:28 +0200 Subject: [PATCH] !remind no longer breaks the db --- src/api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/api.c b/src/api.c index 15b876e..22419cf 100644 --- a/src/api.c +++ b/src/api.c @@ -65,9 +65,9 @@ remind(char * who) title = (char *) sqlite3_column_text(remind_stmt, 0); title = strdup(title); desc = (char *) sqlite3_column_text(remind_stmt, 1); - desc = strdup(desc); + if (desc) { desc = strdup(desc); } else { desc = ""; } repo = (char *) sqlite3_column_text(remind_stmt, 3); - repo = strdup(repo); + if (repo) { repo = strdup(repo); } else { repo = ""; } asprintf(&r, IRC_COLOR_RED "%s: " IRC_COLOR_YELLOW "%s" IRC_COLOR_GREEN " (@" IRC_COLOR_BLUE "%s" IRC_COLOR_GREEN ")" IRC_COLOR_TERMINATE, title, desc, repo); } else