From 8d999514a5d269766c7597fdc5e713de9bddf162 Mon Sep 17 00:00:00 2001 From: Marco Realacci Date: Tue, 22 Nov 2022 22:15:51 +0100 Subject: [PATCH] Handled error for follow_status query in db: GetUserProfile --- service/database/db-profile.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/service/database/db-profile.go b/service/database/db-profile.go index 659383c..c6beebe 100644 --- a/service/database/db-profile.go +++ b/service/database/db-profile.go @@ -50,6 +50,10 @@ func (db *appdbimpl) GetUserProfile(uid string, requesting_uid string) (QueryRes var follow_status bool err = db.c.QueryRow(`SELECT EXISTS (SELECT * FROM "follows" WHERE "follower" = ? AND "followed" = ?)`, requesting_uid, uid).Scan(&follow_status) + if err != nil { + return ERR_INTERNAL, nil, err + } + return SUCCESS, &structures.UserProfile{ UID: uid, Name: name,