From 29026ed6fb1c13639f839c192d8e4b3ab77bb526 Mon Sep 17 00:00:00 2001 From: Untone Date: Sat, 2 Mar 2024 14:44:34 +0300 Subject: [PATCH] type-fix-7 --- server/memorystore/providers/redis/store.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/server/memorystore/providers/redis/store.go b/server/memorystore/providers/redis/store.go index acb1fde..6dbd21c 100644 --- a/server/memorystore/providers/redis/store.go +++ b/server/memorystore/providers/redis/store.go @@ -242,23 +242,22 @@ func (c *provider) GetUserAppDataFromRedis(userId string) (string, error) { combinedData := "{" // Use authorProfileMap["id"] here if necessary - authorId, err := int(authorProfileMap["id"].(float64)) // convert float64 to int - if err != nil { + authorId := int(authorProfileMap["id"].(float64)) // convert float64 to int + if authorId != nil { combinedData += fmt.Sprintf(`"profile": %s`, authorProfileString) } - - authorFollowsAuthorsString, err := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-authors`, authorId)) - if err != nil { + authorFollowsAuthorsString := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-authors`, authorId)) + if authorFollowsAuthorsString != nil { combinedData += fmt.Sprintf(`,"authors": %s`, authorFollowsAuthorsString) } - authorFollowsTopicsString, err := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-topics`, authorId)) - if err != nil { + authorFollowsTopicsString := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:follows-topics`, authorId)) + if authorFollowsTopicsString != nil { combinedData += fmt.Sprintf(`,"topics": %s`, authorFollowsTopicsString) } - authorFollowers, err := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:followers`, authorId)) - if err != nil { + authorFollowers := c.store.Get(c.ctx, fmt.Sprintf(`author:%d:followers`, authorId)) + if authorFollowers != nil { combinedData += fmt.Sprintf(`,"followers": %s`, authorFollowers) }