From 3b52a07ac9a9c80bff3e6912e9b1ab4506774202 Mon Sep 17 00:00:00 2001 From: CrossNox Date: Tue, 29 Nov 2022 14:21:35 -0300 Subject: [PATCH] check for nil --- src/rustint/core.clj | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/rustint/core.clj b/src/rustint/core.clj index 502c09e..3852640 100644 --- a/src/rustint/core.clj +++ b/src/rustint/core.clj @@ -2545,13 +2545,10 @@ ) (defn replace-groups [string groups] - (if (empty? groups) - string - ( - replace-groups - (clojure.string/replace-first string #"\{:?(.\d+)?\}" (first groups)) - (rest groups) - ) + (cond + (nil? groups) string + (empty? groups) string + :else (replace-groups (clojure.string/replace-first string #"\{:?(.\d+)?\}" (first groups)) (rest groups)) ) )