TD2: Check for message text emptyness.
[TD_SR.git] / TD2 / client / ThreadClientoSend.java
index 52db7d5abdcad564bc3dc80635086d265da27794..2475be6d7c80245e5b00eb830d0ff4c778c14e85 100644 (file)
@@ -38,9 +38,11 @@ public class ThreadClientoSend implements Runnable {
                 if (line.equals(".")) {
                     end = true;
                 }
-                Message oMsg = new Message(randName, line, Calendar.getInstance());
-                client.sendoMsg(oMsg);
-                System.out.println(Thread.currentThread().getName() + " a envoye " + oMsg);
+                if (!line.isEmpty()) {
+                    Message oMsg = new Message(randName, line, Calendar.getInstance());
+                    client.sendoMsg(oMsg);
+                    System.out.println(Thread.currentThread().getName() + " a envoye " + oMsg);
+                }
             }
            }
         catch (IOException e) {