File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
src/main/java/org/keepassxc Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,12 @@ public void connect() throws IOException {
5757
5858 @ Override
5959 protected void sendCleartextMessage (String msg ) throws IOException {
60- log .trace ("Sending message: {}" , msg );
61- socket .write (ByteBuffer .wrap (msg .getBytes (StandardCharsets .UTF_8 )));
60+ if (socket .isOpen ()) {
61+ log .trace ("Sending message: {}" , msg );
62+ socket .write (ByteBuffer .wrap (msg .getBytes (StandardCharsets .UTF_8 )));
63+ } else {
64+ throw new IOException ("Socket closed" );
65+ }
6266 }
6367
6468 @ Override
Original file line number Diff line number Diff line change @@ -53,8 +53,12 @@ public void connect() throws IOException {
5353
5454 @ Override
5555 protected void sendCleartextMessage (String msg ) throws IOException {
56- log .trace ("Sending message: {}" , msg );
57- pipe .write (ByteBuffer .wrap (msg .getBytes (StandardCharsets .UTF_8 )), 0 );
56+ if (pipe .isOpen ()) {
57+ log .trace ("Sending message: {}" , msg );
58+ pipe .write (ByteBuffer .wrap (msg .getBytes (StandardCharsets .UTF_8 )), 0 );
59+ } else {
60+ throw new IOException ("Pipe closed" );
61+ }
5862 }
5963
6064 @ Override
You can’t perform that action at this time.
0 commit comments