From 2159be957d77f56042320eb3900643a80c05536e Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 19 May 2021 15:46:21 +0200 Subject: [PATCH] MOBILE-3716 core: Fix token error for logged out sites --- src/core/classes/site.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/classes/site.ts b/src/core/classes/site.ts index 1511a3ac2..a8a70f875 100644 --- a/src/core/classes/site.ts +++ b/src/core/classes/site.ts @@ -146,7 +146,7 @@ export class CoreSite { * @return Site ID. */ getId(): string { - if (!this.id) { + if (this.id === undefined) { // Shouldn't happen for authenticated sites. throw new CoreError('This site doesn\'t have an ID'); } @@ -169,7 +169,7 @@ export class CoreSite { * @return Site token. */ getToken(): string { - if (!this.token) { + if (this.token === undefined) { // Shouldn't happen for authenticated sites. throw new CoreError('This site doesn\'t have a token'); }