client, server: convert chained null checks to optional chaining

This commit is contained in:
Jesse Chan
2020-10-21 11:35:04 +08:00
parent 782898f92f
commit 911b6eecb1
11 changed files with 14 additions and 14 deletions
+2 -2
View File
@@ -55,7 +55,7 @@ class Users {
}
// Wrong data provided
if (credentials == null || credentials.password == null) {
if (credentials?.password == null) {
return callback(false, null, new Error());
}
@@ -120,7 +120,7 @@ class Users {
}
// Username not found.
if (user == null || user._id == null) {
if (user?._id == null) {
return callback(null, new Error('User not found.'));
}