summary refs log tree commit diff
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
commit68886cc93256a8b415371ba8a4e6a4a767965d6a (patch)
treef64111a2a1856b7397058644ed2eacfcd6d8abb5
parentDont send sessions replace or presence update for unidentified users (diff)
downloadserver-68886cc93256a8b415371ba8a4e6a4a767965d6a.tar.xz
Fix setting user premium_type/etc (non-nullable) to null in db when null in config
-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