aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-26 16:28:30 -0700
committerAdam Soltys <[email protected]>2024-08-26 16:28:30 -0700
commit00e43ddc0bf3d6dd719fc9295d156567fa2fecfb (patch)
tree9719782a64056ff904c0053223d70547bb7f398c /lib/utils.js
parent3c611a4e6fbb31fa7d8e32ed256037c45aca1d6d (diff)
downloadcoinos-server-00e43ddc0bf3d6dd719fc9295d156567fa2fecfb.tar.gz
coinos-server-00e43ddc0bf3d6dd719fc9295d156567fa2fecfb.zip
switch to bun
Diffstat (limited to 'lib/utils.js')
-rw-r--r--lib/utils.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils.js b/lib/utils.js
index f53b76d2..ada32521 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -70,7 +70,7 @@ export let fields = [
export let getUser = async (username) => {
if (username === "undefined") fail("invalid user");
let user = await migrate(username);
- if (!user.nwc) {
+ if (user && !user.nwc) {
user.nwc = bytesToHex(randomBytes(32));
s(`user:${user.id}`, user);
}