From 293fa41d3b9381857c33553c0b66d2ad62eda964 Mon Sep 17 00:00:00 2001 From: Sebastian Crane Date: Mon, 28 Feb 2022 21:09:05 +0000 Subject: [PATCH] Fix exception when dispatch-command returns nil Signed-off-by: Sebastian Crane --- src/irc.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/irc.clj b/src/irc.clj index 06aa7f0..2259b0b 100644 --- a/src/irc.clj +++ b/src/irc.clj @@ -9,9 +9,9 @@ (defn irc-callback [state config connection type & m] (let [{:keys [channel]} (:irc config) {:keys [nick text target]} type] - (when (= target channel) - (doseq [line (str/split-lines (dispatch-command state nick text))] - (irclj.core/message connection channel line))))) + (some->> (dispatch-command state nick text) + (str/split-lines) + (run! (partial irclj.core/message connection channel))))) (defn new-irc-connection [state config] (let [{:keys [server port name nick channel]} (:irc config)]