Add an extra check for setting names

This commit is contained in:
Pavel Djundik 2019-01-16 10:52:09 +02:00 committed by GitHub
parent 589e846b73
commit 95a0045a0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -494,6 +494,10 @@ function initializeClient(socket, client, token, lastMessage) {
return; return;
} }
if (typeof newSetting.name !== "string" || newSetting.name[0] === "_") {
return;
}
// Older user configs will not have the clientSettings property. // Older user configs will not have the clientSettings property.
if (!client.config.hasOwnProperty("clientSettings")) { if (!client.config.hasOwnProperty("clientSettings")) {
client.config.clientSettings = {}; client.config.clientSettings = {};