added defer to call to prevent failure.
This commit is contained in:
parent
103f4ccd2c
commit
9a872fd388
@ -49,6 +49,8 @@ func (s Service) Client() *msgraphsdk.GraphServiceClient {
|
|||||||
// application/json writer within the adapter.
|
// application/json writer within the adapter.
|
||||||
func (s Service) Serialize(object absser.Parsable) ([]byte, error) {
|
func (s Service) Serialize(object absser.Parsable) ([]byte, error) {
|
||||||
writer, err := s.adapter.GetSerializationWriterFactory().GetSerializationWriter("application/json")
|
writer, err := s.adapter.GetSerializationWriterFactory().GetSerializationWriter("application/json")
|
||||||
|
defer writer.Close()
|
||||||
|
|
||||||
if err != nil || writer == nil {
|
if err != nil || writer == nil {
|
||||||
return nil, errors.Wrap(err, "creating json serialization writer")
|
return nil, errors.Wrap(err, "creating json serialization writer")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user