TD2: Ensure chat clients will not send empty message.
[TD_SR.git] / TD2 / client / ThreadClientSend.java
index 399cfd3139f819247e3a301fe9c88a52b0ed9724..639228fe45f6eef313a2abd9998b92ca721c9b9d 100644 (file)
@@ -17,8 +17,10 @@ public class ThreadClientSend implements Runnable {
                 if (line.equals(".")) {
                     end = true;
                 }
-                client.sendMsg(line);
-                System.out.println(Thread.currentThread().getName() + " a envoye " + line);
+                if (line.length() != 0) {
+                    client.sendMsg(line);
+                    System.out.println(Thread.currentThread().getName() + " a envoye " + line);
+                }
             }
         }
         catch (IOException e) {