Fix wrong check for IDs validation

pull/77/head
MillenniumEarl 2021-03-10 12:30:52 +01:00
parent 5fa50505e4
commit 712bd6a8d6
3 changed files with 3 additions and 3 deletions

View File

@ -151,7 +151,7 @@ export default class PlatformUser implements ILazy {
if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED);
// Check ID // 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 // Prepare the URL
const url = new URL(this.id.toString(), `${urls.MEMBERS}/`).toString(); const url = new URL(this.id.toString(), `${urls.MEMBERS}/`).toString();

View File

@ -102,7 +102,7 @@ export default class Post implements ILazy {
if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED);
// Check ID // 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 // Fetch HTML page containing the post
const url = new URL(this.id.toString(), urls.POSTS).toString(); const url = new URL(this.id.toString(), urls.POSTS).toString();

View File

@ -237,7 +237,7 @@ export default class Thread implements ILazy {
if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED); if (!shared.isLogged) throw new UserNotLogged(USER_NOT_LOGGED);
// Check ID // 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 // Prepare the url
this._url = new URL(this.id.toString(), urls.THREADS).toString(); this._url = new URL(this.id.toString(), urls.THREADS).toString();