Client chatListener now throws an IO exception of the chatMSg from the server is null.

This commit is contained in:
Sebastian Lenzlinger 2022-04-08 16:15:04 +02:00
parent 968cb94f21
commit 4557b4801b

View File

@ -89,10 +89,10 @@ public class Client {
chatMsg = in.readLine(); //todo: maybe if chatMsg = in.readLine(); //todo: maybe if
if (chatMsg != null) { if (chatMsg != null) {
parse(chatMsg); parse(chatMsg);
} else { System.out.println("chatMsg is null");} } else { System.out.println("chatMsg is null"); throw new IOException();}
} catch (IOException e) { } catch (IOException e) {
//e.printStackTrace(); //e.printStackTrace();
LOGGER.debug("Exception while trying to read message"); LOGGER.debug("Exception while trying to read message: " + e.getMessage());
disconnectFromServer(); disconnectFromServer();
} }