MOBILE-3716 core: Fix token error for logged out sites

main
Dani Palou 2021-05-19 15:46:21 +02:00
parent 1e03a201a4
commit 2159be957d
1 changed files with 2 additions and 2 deletions

View File

@ -146,7 +146,7 @@ export class CoreSite {
* @return Site ID. * @return Site ID.
*/ */
getId(): string { getId(): string {
if (!this.id) { if (this.id === undefined) {
// Shouldn't happen for authenticated sites. // Shouldn't happen for authenticated sites.
throw new CoreError('This site doesn\'t have an ID'); throw new CoreError('This site doesn\'t have an ID');
} }
@ -169,7 +169,7 @@ export class CoreSite {
* @return Site token. * @return Site token.
*/ */
getToken(): string { getToken(): string {
if (!this.token) { if (this.token === undefined) {
// Shouldn't happen for authenticated sites. // Shouldn't happen for authenticated sites.
throw new CoreError('This site doesn\'t have a token'); throw new CoreError('This site doesn\'t have a token');
} }