From a69c047854b53289c9c4d844d72d7f2d9d0022de Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 13 Jan 2023 13:44:58 +1100 Subject: Fix setting user premium_type/etc (non-nullable) to null in db when null in config --- src/util/entities/User.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util') diff --git a/src/util/entities/User.ts b/src/util/entities/User.ts index edc84dff..e8b724be 100644 --- a/src/util/entities/User.ts +++ b/src/util/entities/User.ts @@ -101,10 +101,10 @@ export class User extends BaseClass { mobile: boolean = false; // if the user has mobile app installed @Column() - premium: boolean = Config.get().defaults.user.premium; // if user bought individual premium + premium: boolean = Config.get().defaults.user.premium ?? false; // if user bought individual premium @Column() - premium_type: number = Config.get().defaults.user.premiumType; // individual premium level + premium_type: number = Config.get().defaults.user.premiumType ?? 0; // individual premium level @Column() bot: boolean = false; // if user is bot @@ -134,7 +134,7 @@ export class User extends BaseClass { premium_since: Date; // premium date @Column({ select: false }) - verified: boolean = Config.get().defaults.user.verified; // email is verified + verified: boolean = Config.get().defaults.user.verified ?? true; // email is verified @Column() disabled: boolean = false; // if the account is disabled -- cgit 1.4.1