Browse Source

Avoid closing fromServerReader in case of null

remotes/origin/feature/client/exchange-messages-between-client-server
Alena Bandarovich 11 months ago
parent
commit
64626610ca
  1. 10
      src/main/java/ChatClient.java

10
src/main/java/ChatClient.java

@ -69,10 +69,12 @@ public class ChatClient extends JFrame implements KeyListener {
} }
} }
try {
fromServerReader.close();
} catch (IOException e) {
e.printStackTrace();
if (null != fromServerReader) {
try {
fromServerReader.close();
} catch (IOException e) {
e.printStackTrace();
}
} }
toServerWriter.close(); toServerWriter.close();

Loading…
Cancel
Save