aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-12-31 15:26:52 -0800
committerAdam Soltys <[email protected]>2024-12-31 15:26:52 -0800
commita323fa03caf05332cfd0f72539532b9a2ed86221 (patch)
treea96d6bb85c6ebc8b383826b0c251a6c95be260c5 /lib/utils.ts
parente2eb8a2b1a99afc8d6bc5c7a8124496ecde865c7 (diff)
downloadcoinos-server-a323fa03caf05332cfd0f72539532b9a2ed86221.tar.gz
coinos-server-a323fa03caf05332cfd0f72539532b9a2ed86221.zip
check for user
Diffstat (limited to 'lib/utils.ts')
-rw-r--r--lib/utils.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/utils.ts b/lib/utils.ts
index 278a2c82..61277b10 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -80,7 +80,7 @@ export const getUser = async (username) => {
update = true;
}
- if (user.profile) {
+ if (user?.profile) {
user.picture = `https://coinos.io/api/public/${user.profile}.webp`;
delete user.profile;
@@ -90,7 +90,7 @@ export const getUser = async (username) => {
update = true;
}
- if (user.address) {
+ if (user?.address) {
user.about = user.address;
delete user.address;
update = true;