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) }