]> Pileus Git - ~andy/spades/commitdiff
Prevent crash with zero-length strings
authorAndy Spencer <andy753421@gmail.com>
Sun, 26 Apr 2015 22:12:51 +0000 (22:12 +0000)
committerAndy Spencer <andy753421@gmail.com>
Sun, 26 Apr 2015 22:12:51 +0000 (22:12 +0000)
src/org/pileus/spades/Client.java

index e02e664fe7bb64921bc3fff62631bb4a27646f4e..b56decd472f91c29c4b8b305750c9007933153e1 100644 (file)
@@ -118,6 +118,8 @@ public class Client
 
        public Message send(String txt)
        {
+               if (txt == null || txt.length() == 0)
+                       return null;
                if (this.validate() != State.READY)
                        return null;
                Message msg = new Message(this.channel, this.name, txt);