From df3f91fbc6d0b75c4c875c787d8ab29b2f1d2768 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 28 Dec 2022 18:43:04 +0000 Subject: handle empty follows --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/utils.js') 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`); } -- cgit v1.2.3