aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.js
diff options
context:
space:
mode:
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);
}