paquettg / leaguewrap

League of Legend API wrapper
MIT License
67 stars 28 forks source link

Prevent $body->read() error. #100

Closed ghost closed 9 years ago

ghost commented 9 years ago

For Line 91: If getSize(" equals 0 due to a page not returning anything, such as a 404 response, then read() will make an exception stating that the byte size needs to be more than 0. No need to use read() if the body is null or empty. So $content will take null as is just to return the empty body. Only the $code will matter at this point for the Response() instance.

This error occurs only for League() as far as I know. Even Summoner() provides error content.