TD2: Ensure chat clients will not send empty message.
[TD_SR.git] / TD2 / IHM / ThreadIHMSend.java
index 2b1a64aba6b80590f8505ed4dff8e70f8f764474..f8077c968fdf03ed6dc4098fc04670180418d282 100644 (file)
@@ -17,8 +17,10 @@ public class ThreadIHMSend 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 (Exception e) {