diff --git a/src/scripts/classes/mapping/platform-user.ts b/src/scripts/classes/mapping/platform-user.ts index 0817805..9f9e621 100644 --- a/src/scripts/classes/mapping/platform-user.ts +++ b/src/scripts/classes/mapping/platform-user.ts @@ -151,7 +151,7 @@ export default class PlatformUser implements ILazy { if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); // Check ID - if (!this.id && this.id < 1) throw new InvalidID(INVALID_USER_ID); + if (!this.id || this.id < 1) throw new InvalidID(INVALID_USER_ID); // Prepare the URL const url = new URL(this.id.toString(), `${urls.MEMBERS}/`).toString(); diff --git a/src/scripts/classes/mapping/post.ts b/src/scripts/classes/mapping/post.ts index 1d3f59c..8c42dd7 100644 --- a/src/scripts/classes/mapping/post.ts +++ b/src/scripts/classes/mapping/post.ts @@ -102,7 +102,7 @@ export default class Post implements ILazy { if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); // Check ID - if (!this.id && this.id < 1) throw new InvalidID(INVALID_POST_ID); + if (!this.id || this.id < 1) throw new InvalidID(INVALID_POST_ID); // Fetch HTML page containing the post const url = new URL(this.id.toString(), urls.POSTS).toString(); diff --git a/src/scripts/classes/mapping/thread.ts b/src/scripts/classes/mapping/thread.ts index 5ea3d43..201812c 100644 --- a/src/scripts/classes/mapping/thread.ts +++ b/src/scripts/classes/mapping/thread.ts @@ -237,7 +237,7 @@ export default class Thread implements ILazy { if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); // Check ID - if (!this.id && this.id < 1) throw new InvalidID(INVALID_THREAD_ID); + if (!this.id || this.id < 1) throw new InvalidID(INVALID_THREAD_ID); // Prepare the url this._url = new URL(this.id.toString(), urls.THREADS).toString();