From 057cc86ae512f906b4268667c13a9b905ee46e8e Mon Sep 17 00:00:00 2001 From: Felisp Date: Sat, 23 Dec 2023 00:48:08 +0100 Subject: [PATCH] Use thread OP as title if title is not provided Avoids NullPointerException when doing final filtering on thread titles --- src/rss_thread_watch/watcher.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rss_thread_watch/watcher.clj b/src/rss_thread_watch/watcher.clj index e6b33db..56489a2 100644 --- a/src/rss_thread_watch/watcher.clj +++ b/src/rss_thread_watch/watcher.clj @@ -33,7 +33,9 @@ (recur (rest remaining-threads) threads-total (inc index) - (conj! ret {:title (:sub thread) + (conj! ret {:title (or (:sub thread) ;We use thread title if thread has it + (:com thread) ;we use body if thread has it + "") ;Thread has nothing, this prevents null pointer :no (:no thread) :chod (* 100 (float (/ index threads-total)))}))))))