Fix TypeError when there was no response body.

This will prevent `TypeError: argument of type 'NoneType' is not iterable` if there was no response body, e.g. when status code was 400 or similar. (In that case `body` will be `None`.)