From 9a872fd38832ccc404fd21b06b1c30d8ec9c38c7 Mon Sep 17 00:00:00 2001 From: Danny Adams Date: Fri, 6 Jan 2023 09:37:40 -0500 Subject: [PATCH] added defer to call to prevent failure. --- src/internal/connector/graph/service.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/internal/connector/graph/service.go b/src/internal/connector/graph/service.go index 7780e7941..40595b015 100644 --- a/src/internal/connector/graph/service.go +++ b/src/internal/connector/graph/service.go @@ -49,6 +49,8 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient { // application/json writer within the adapter. func (s Service) Serialize(object absser.Parsable) ([]byte, error) { writer, err := s.adapter.GetSerializationWriterFactory().GetSerializationWriter("application/json") + defer writer.Close() + if err != nil || writer == nil { return nil, errors.Wrap(err, "creating json serialization writer") }