diff options
| author | Adam Soltys <[email protected]> | 2022-12-28 18:43:04 +0000 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-12-28 18:43:04 +0000 |
| commit | df3f91fbc6d0b75c4c875c787d8ab29b2f1d2768 (patch) | |
| tree | 8d1e058404cdd1764a7c2f289fa8da9e2349f06f /lib | |
| parent | 204c47baa30e1ee4b1ff27b0abd58a7a5cf47db7 (diff) | |
| download | coinos-server-df3f91fbc6d0b75c4c875c787d8ab29b2f1d2768.tar.gz coinos-server-df3f91fbc6d0b75c4c875c787d8ab29b2f1d2768.zip | |
handle empty follows
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils.js b/lib/utils.js index 49f95a00..6a4bc1b2 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -65,7 +65,7 @@ export const getUser = async (username, transaction) => { }); await wait(() => !store.fetching[pubkey], 100, 10); - user.follows = JSON.parse(await redis.get(`${pubkey}:follows`)); + user.follows = JSON.parse(await redis.get(`${pubkey}:follows`)) || []; user.followers = await redis.sMembers(`${pubkey}:followers`); } |
