Fix null reference on non-HTTP response exception

When response.ResponseStatus == ResponseStatus.Error restResponse is null and subsequently null reference exception is raised.