TD2: Check for message text emptyness.
[TD_SR.git] / TD2 / IHM / ThreadIHMSend.java
index f173996f1650ff4066190d42e713dbf29a27f18c..5113989da7208d3ba9e9ee222bb3094239a993cf 100644 (file)
@@ -10,7 +10,6 @@ public class ThreadIHMSend implements Runnable {
     }
 
     public void run() {
-        BufferedReader userInput = null;
         try {
             boolean end = false;
             while (!end) {
@@ -18,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.isEmpty()) {
+                    client.sendMsg(line);
+                    System.out.println(Thread.currentThread().getName() + " a envoye " + line);
+                }
             }
         }
         catch (Exception e) {