aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-02-21 14:02:46 -0800
committerAdam Soltys <[email protected]>2024-02-21 14:02:46 -0800
commit10bf90960f75304c351bc3bf56c199777916fbad (patch)
treeb0b25480cbef21ef947b58ac8634ff6d3d59f944
parent689c16c5017ed447559a15cb287044a9cceee288 (diff)
downloadcoinos-server-10bf90960f75304c351bc3bf56c199777916fbad.tar.gz
coinos-server-10bf90960f75304c351bc3bf56c199777916fbad.zip
check exists
-rw-r--r--routes/users.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/routes/users.js b/routes/users.js
index 7598a8a6..5b76821d 100644
--- a/routes/users.js
+++ b/routes/users.js
@@ -221,7 +221,7 @@ export default {
}
if (pubkey) exists = await getUser(pubkey);
- if (username !== exists.username) {
+ if (exists && username !== exists.username) {
warn("key in use", pubkey, exists.username);
if (exists.anon) await db.del(`user:${pubkey}`);
else fail("Key in use by another account");