瀏覽代碼

Fix crash on an empty response

This check was a leftover from the resumeKey pagination, where empty responses are supposed to be impossible. With the page pagination, they are possible.
master
JustAnotherArchivist 2 年之前
父節點
當前提交
5bc3d4b020
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      ia-cdx-search

+ 3
- 1
ia-cdx-search 查看文件

@@ -51,7 +51,9 @@ async def wait_first_and_print(tasks):
return
task = tasks.popleft()
url, code, o, connection = await task
assert o, 'got empty response'
if not o:
print(f'Completed processing page {task._ia_cdx_page} (0 results)', file = sys.stderr)
return task._ia_cdx_page, connection
fields = o[0]
assert all(len(v) == len(fields) for v in o[1:]), 'got unexpected response format'
for row in o[1:]:


Loading…
取消
儲存