aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStuart Sierra <mail@stuartsierra.com>2009-08-20 16:14:15 -0400
committerStuart Sierra <mail@stuartsierra.com>2009-08-20 16:14:15 -0400
commita9f24ee1192447344d9ac02a37e0c521412fbe1e (patch)
tree2fcbed4f1c6cbbf0963f4c9d4bdaebb83109196f
parent0ab6bd4dfa56e4977944355e02a68c80d7c38fb8 (diff)
http/agent.clj: handle null response stream on disconnect
-rw-r--r--src/clojure/contrib/http/agent.clj3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/clojure/contrib/http/agent.clj b/src/clojure/contrib/http/agent.clj
index c5a6b51c..47424e2f 100644
--- a/src/clojure/contrib/http/agent.clj
+++ b/src/clojure/contrib/http/agent.clj
@@ -119,7 +119,8 @@
"Agent action that closes the response body stream and disconnects
the HttpURLConnection."
[state options]
- (.close #^InputStream (::response-stream state))
+ (when (::response-stream state)
+ (.close #^InputStream (::response-stream state)))
(.disconnect #^HttpURLConnection (::connection state))
(assoc state
::response-stream nil