Add more type checks for config.json

This commit is contained in:
Simon Ser 2021-10-09 09:57:54 +02:00
parent 8cc61bf577
commit d2ac1e152a

View file

@ -192,10 +192,12 @@ export default class App extends Component {
let connectParams = {};
if (config.server) {
connectParams.url = config.server.url;
if (typeof config.server.url === "string") {
connectParams.url = config.server.url;
}
if (Array.isArray(config.server.autojoin)) {
connectParams.autojoin = config.server.autojoin;
} else if (config.server.autojoin) {
} else if (typeof config.server.autojoin === "string") {
connectParams.autojoin = [config.server.autojoin];
}
}