diff --git a/main.c b/main.c index ba165ec..7194fa4 100644 --- a/main.c +++ b/main.c @@ -258,8 +258,8 @@ static void bot_command_add(struct discord *client, const struct discord_interac } feed.title = mrss_feed->title; - // if there are no entries, set the last pubDate to zero. - feed.last_pubDate = mrss_feed->item ? mrss_feed->item->pubDate : 0; + // if there are no entries, we can't just give it the invalid pointer + feed.last_pubDate = mrss_feed->item ? mrss_feed->item->pubDate : "Never"; zblock_feed_info_err insert_res = zblock_feed_info_insert(database_conn, &feed); if (insert_res) {