From 47fbf69e985cedfed2a02edab6f5f536b13e2f24 Mon Sep 17 00:00:00 2001 From: Till Faelligen Date: Tue, 10 Aug 2021 13:51:04 +0200 Subject: [PATCH] Add error checks Signed-off-by: Till Faelligen --- appservice/query/query.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/appservice/query/query.go b/appservice/query/query.go index 9f6c79a80..54867b87d 100644 --- a/appservice/query/query.go +++ b/appservice/query/query.go @@ -51,6 +51,9 @@ func (a *AppServiceQueryAPI) RoomAliasExists( if appservice.URL != "" && appservice.IsInterestedInRoomAlias(request.Alias) { // The full path to the rooms API, includes hs token URL, err := url.Parse(appservice.URL + roomAliasExistsPath) + if err != nil { + return err + } URL.Path += request.Alias apiURL := URL.String() + "?access_token=" + appservice.HSToken @@ -114,6 +117,9 @@ func (a *AppServiceQueryAPI) UserIDExists( if appservice.URL != "" && appservice.IsInterestedInUserID(request.UserID) { // The full path to the rooms API, includes hs token URL, err := url.Parse(appservice.URL + userIDExistsPath) + if err != nil { + return err + } URL.Path += request.UserID apiURL := URL.String() + "?access_token=" + appservice.HSToken