Showing
1 changed file
with
7 additions
and
5 deletions
... | ... | @@ -253,11 +253,13 @@ public final class EdgeGrpcSession implements Closeable { |
253 | 253 | } |
254 | 254 | |
255 | 255 | private void sendResponseMsg(ResponseMsg responseMsg) { |
256 | - try { | |
257 | - responseMsgLock.lock(); | |
258 | - outputStream.onNext(responseMsg); | |
259 | - } finally { | |
260 | - responseMsgLock.unlock(); | |
256 | + if (isConnected()) { | |
257 | + try { | |
258 | + responseMsgLock.lock(); | |
259 | + outputStream.onNext(responseMsg); | |
260 | + } finally { | |
261 | + responseMsgLock.unlock(); | |
262 | + } | |
261 | 263 | } |
262 | 264 | } |
263 | 265 | ... | ... |