Skip to content

Commit 3ee4a34

Browse files
committedJan 16, 2025·
prevent nil messages from messing up alts
1 parent 313569a commit 3ee4a34

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ pom.xml.versionsBackup
2828
.classpath
2929
ccw.repl.cmdhistory.prefs
3030
nbactions.xml
31+
.DS_Store

‎src/main/clojure/clojure/core/async/flow/impl.clj

+3-2
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,9 @@
202202
(loop [nstatus nstatus, nstate nstate, msgs (seq msgs)]
203203
(if (or (nil? msgs) (= nstatus :exit))
204204
[nstatus nstate]
205-
(let [[v c] (async/alts!!
206-
[control [outc (first msgs)]]
205+
(let [m (if-some [m (first msgs)] m (throw "messages must be non-nil"))
206+
[v c] (async/alts!!
207+
[control [outc m]]
207208
:priority true)]
208209
(if (= c control)
209210
(let [nnstatus (handle-command nstatus v)

0 commit comments

Comments
 (0)
Please sign in to comment.