diff options
-rw-r--r-- | socket.js | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -60,9 +60,8 @@ class Socket extends retryws { } this.write = function(chars){ //chars is an list of pairs [ pixel coordinate (y/x < 16), char ] - if (chars.length > 200){ - throw "Too many characters to write by server decree"; - } + if (chars.length > 200) throw "Too many characters to write by server decree"; + if (chars.length == 0) throw "Send at least a character."; let write = []; for (let cha of chars){ let coord = cha[0]; |