Skip to content

Commit 8af6efa

Browse files
committed
fix issue with toUpperCase
1 parent 3e0a3d2 commit 8af6efa

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/api/index.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export class AtelierAPI {
4343
public readonly wsOrFile?: string | vscode.Uri;
4444

4545
public get ns(): string {
46-
return (this.namespace || this._config.ns).toUpperCase();
46+
return (this.namespace || this._config.ns || "").toUpperCase();
4747
}
4848

4949
public get config(): ConnectionSettings {
@@ -340,16 +340,12 @@ export class AtelierAPI {
340340
}
341341
}
342342

343-
/**
344-
* Use the serverInfo endpoint. Connection object does not need to have specified a namespace when instantiated.
345-
*/
346343
public serverInfo(): Promise<Atelier.Response<Atelier.Content<Atelier.ServerInfo>>> {
347344
return this.request(0, "GET").then((info) => {
348345
if (info && info.result && info.result.content && info.result.content.api > 0) {
349346
const data = info.result.content;
350347
const apiVersion = data.api;
351-
// If this is a namespace-specific connection, throw if it doesn't exist or if the user has no access to it
352-
if (this.ns && !data.namespaces.includes(this.ns.toUpperCase())) {
348+
if (!data.namespaces.includes(this.ns)) {
353349
throw {
354350
code: "WrongNamespace",
355351
message: `This server does not have specified namespace '${this.ns}'.\n

0 commit comments

Comments
 (0)