Fix nil panic in certain error conditions

This commit is contained in:
Jeff Mitchell 2016-08-02 14:57:11 -04:00
parent 6389a3cc31
commit 1fc837c22a
1 changed files with 1 additions and 1 deletions

View File

@ -232,7 +232,7 @@ func respondErrorCommon(w http.ResponseWriter, resp *logical.Response, err error
}
}
if resp != nil {
if resp != nil && resp.IsError(){
err = fmt.Errorf("%s", resp.Data["error"].(string))
}