aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--socket.js5
1 files changed, 2 insertions, 3 deletions
diff --git a/socket.js b/socket.js
index aefc1c0..c165597 100644
--- a/socket.js
+++ b/socket.js
@@ -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];