Fix panic when unwrapping if the server EOFs
This commit is contained in:
parent
736a4b111c
commit
0f5b847748
|
@ -135,9 +135,10 @@ func (c *Logical) Unwrap(wrappingToken string) (*Secret, error) {
|
|||
}
|
||||
|
||||
resp, err := c.c.RawRequest(r)
|
||||
if resp != nil {
|
||||
defer resp.Body.Close()
|
||||
if resp == nil {
|
||||
return nil, nil
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
if err != nil && resp.StatusCode != 404 {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ func (c *UnwrapCommand) Run(args []string) int {
|
|||
return 1
|
||||
}
|
||||
if secret == nil {
|
||||
c.Ui.Error("Secret returned was nil")
|
||||
c.Ui.Error("Server gave empty response or secret returned was empty")
|
||||
return 1
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue