summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-13 13:44:58 +1100
committerMadeline <46743919+MaddyUnderStars@users.noreply.github.com>2023-01-13 13:44:58 +1100
commita69c047854b53289c9c4d844d72d7f2d9d0022de (patch)
tree62d1abe9aaf834fd8095c329acf1ac900ac742d1 /src
parentDont send sessions replace or presence update for unidentified users (diff)
downloadserver-a69c047854b53289c9c4d844d72d7f2d9d0022de.tar.xz
Fix setting user premium_type/etc (non-nullable) to null in db when null in config
Diffstat (limited to 'src')
-rw-r--r--src/util/entities/User.ts6
1 files changed, 3 insertions, 3 deletions
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