diff options
-rw-r--r-- | lib/chef/http/json_output.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/http/json_output.rb b/lib/chef/http/json_output.rb index 179f1de4ef..dc363cdc54 100644 --- a/lib/chef/http/json_output.rb +++ b/lib/chef/http/json_output.rb @@ -61,7 +61,9 @@ class Chef [http_response, rest_request, return_value] else Chef::Log.debug("Expected JSON response, but got content-type '#{http_response['content-type']}'") - Chef::Log.debug("Response body contains:\n#{http_response.body.length < 256 ? http_response.body : http_response.body[0..256] + " [...truncated...]"}") + if http_response.body + Chef::Log.debug("Response body contains:\n#{http_response.body.length < 256 ? http_response.body : http_response.body[0..256] + " [...truncated...]"}") + end return [http_response, rest_request, http_response.body.to_s] end end |