aboutsummaryrefslogtreecommitdiffstats
path: root/src/server/Main.hx
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/Main.hx')
-rw-r--r--src/server/Main.hx8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/server/Main.hx b/src/server/Main.hx
index a525f65..2547761 100644
--- a/src/server/Main.hx
+++ b/src/server/Main.hx
@@ -164,9 +164,7 @@ class Main {
}
function generateConfigSalt():String {
- if (userList.salt == null) {
- userList.salt = Sha256.encode('${Math.random()}');
- }
+ userList.salt ??= Sha256.encode('${Math.random()}');
return userList.salt;
}
@@ -222,8 +220,8 @@ class Main {
bans: []
};
final users:UserList = Json.parse(File.getContent(customPath));
- if (users.admins == null) users.admins = [];
- if (users.bans == null) users.bans = [];
+ users.admins ??= [];
+ users.bans ??= [];
for (field in users.bans) {
field.toDate = Date.fromString(cast field.toDate);
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage