Permalink
Browse files

Avoid null pointer.

  • Loading branch information...
1 parent 117edcb commit aa28279866edcc4e4f1a924045fee96d1c5c263c @keforbes keforbes committed Mar 12, 2013
@@ -354,6 +354,11 @@ public Command parseAndExecute(String first, String command) {
LinkedList<String> tokens = new LinkedList<String>();
while(nizer.hasMoreTokens())
tokens.add(nizer.nextToken().trim());
+
+ if(tokens.isEmpty()) {
+ //someone hit "enter" without providing a command
+ return null;
+ }
//separate '!' from command name
if(tokens.peek().endsWith("!")) {

0 comments on commit aa28279

Please sign in to comment.