From ed9e3605a76c225c59d950d2b4f7d7df0ef93d39 Mon Sep 17 00:00:00 2001 From: icedream Date: Thu, 5 Nov 2015 19:04:23 +0100 Subject: [PATCH] Validate "nickname" configuration option. Fixes #14. --- config.iced | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config.iced b/config.iced index d4bf2de..92f9554 100644 --- a/config.iced +++ b/config.iced @@ -28,6 +28,9 @@ nconf.defaults if not nconf.get("ts3-server") throw new Error "You need to provide a TeamSpeak3 server URL (starts with ts3server:// and can be generated from any TS3 client GUI)." +if nconf.get("nickname")? and (nconf.get("nickname").length < 3 or nconf.get("nickname").length > 30 + throw new Error "Nickname must be between 3 and 30 characters long." + console.log "Configuration loaded." if nconf.get "dump-config"