Skip to content

Commit

Permalink
protecoes erros servers.json
Browse files Browse the repository at this point in the history
  • Loading branch information
lwtnb-wrk committed May 6, 2024
1 parent f13f171 commit ac936ef
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,11 @@ export class ServersConfig {
includes = server.includes as Array<string>;
} else {
const servers = getServersConfig();
includes = servers.includes as Array<string>;
if (servers.includes) {
includes = servers.includes as Array<string>;
} else {
includes = [];
}
}

if (includes.length > 0) {
Expand Down Expand Up @@ -1096,10 +1100,16 @@ function getServersConfig() {
}
}

//garante a existencia da sessão
//garante a existencia de sessões criticas
if (!config.savedTokens) {
config.savedTokens = [];
}
if (!config.connectedServer) {
config.connectedServer = {};
}
if (!config.includes) {
config.includes = [];
}

//compatibilização com arquivos gravados com versão da extensão
//anterior a 26/06/20
Expand Down

0 comments on commit ac936ef

Please sign in to comment.