Skip to content

Commit

Permalink
Prevent crash in blob object manager
Browse files Browse the repository at this point in the history
  • Loading branch information
adreed-msft committed May 8, 2024
1 parent 13f2475 commit 3c931d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions e2etest/newe2e_resource_managers_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -708,8 +708,10 @@ func (b *BlobObjectResourceManager) Download(a Asserter) io.ReadSeeker {
}

buf := &bytes.Buffer{}
_, err = io.Copy(buf, resp.Body)
a.NoError("Read body", err)
if err != nil || resp.Body == nil {
_, err = io.Copy(buf, resp.Body)
a.NoError("Read body", err)
}

return bytes.NewReader(buf.Bytes())
}
Expand Down

0 comments on commit 3c931d5

Please sign in to comment.