Commit 61aec34
fix: handle non-list response_stream in HttpResponse.json property (#1903)
When using the aiohttp backend and Google API returns a 500 error,
the response_stream can be an aiohttp.ClientResponse object instead
of a list. This causes 'TypeError: ClientResponse object is not
subscriptable' when trying to access response_stream[0].
This fix adds a type check before attempting list access, returning
None for non-list response_stream values to allow proper error
handling to continue.
Fixes: #1897
Co-authored-by: Amy Wu <wuamy@google.com>1 parent c567613 commit 61aec34
1 file changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
271 | 277 | | |
272 | 278 | | |
273 | 279 | | |
| |||
0 commit comments