fixed NPE if response is not valid content (text/html for example).