diff --git a/cs656/lab3/ChatClient.java b/cs656/lab3/ChatClient.java index 82644a6..cb439c9 100644 --- a/cs656/lab3/ChatClient.java +++ b/cs656/lab3/ChatClient.java @@ -225,15 +225,22 @@ public class ChatClient { user = rest.substring(0, idx); RegistrationInfo ri = myPServ.lookup(user); - /* only send a message to available users */ - if (ri.getStatus()) + if (ri == null) { - String message = rest.substring(idx + 1); - sendUserMessage(user, message); + System.err.println("Could not find user \"" + user + "\"!"); } else { - System.out.println(user + " is busy!"); + /* only send a message to available users */ + if (ri.getStatus()) + { + String message = rest.substring(idx + 1); + sendUserMessage(user, message); + } + else + { + System.out.println(user + " is busy!"); + } } } else diff --git a/cs656/lab3/ChordClient.java b/cs656/lab3/ChordClient.java index d2e7206..68d6d6a 100644 --- a/cs656/lab3/ChordClient.java +++ b/cs656/lab3/ChordClient.java @@ -43,7 +43,7 @@ public class ChordClient URL localURL = null; try { - localURL = new URL( protocol + "://" + host + ":5353/"); + localURL = new URL(protocol + "://" + host + ":5353/"); } catch (MalformedURLException e) {