aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-01-24 04:16:36 +0000
committerAdam Soltys <[email protected]>2024-01-24 04:16:36 +0000
commit712560b83d8834145b974f2324b0deb5c18b91b8 (patch)
tree05bffcc713434bd0e27c350f744f7ec6dde770b4 /lib
parent9c7d46dbd78e4ba217adbc9d48fbd6e91f5fad99 (diff)
downloadcoinos-server-712560b83d8834145b974f2324b0deb5c18b91b8.tar.gz
coinos-server-712560b83d8834145b974f2324b0deb5c18b91b8.zip
check for undefined users
Diffstat (limited to 'lib')
-rw-r--r--lib/db.js5
-rw-r--r--lib/utils.js1
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/db.js b/lib/db.js
index 20fc2cd2..61859dcb 100644
--- a/lib/db.js
+++ b/lib/db.js
@@ -90,10 +90,7 @@ export let g = async (k) => {
};
export let s = (k, v) => {
- if (k === "user:null" || k === "user:undefined") {
- warn("###### NULL USER #######");
- console.trace();
- }
+ if (k === "user:null" || k === "user:undefined") fail("null user");
db.set(k, JSON.stringify(v));
};
diff --git a/lib/utils.js b/lib/utils.js
index e6aba14a..866bbaf9 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -66,5 +66,6 @@ export let fields = [
];
export let getUser = async (username) => {
+ if (username === "undefined") fail("invalid user");
return migrate(username);
};