Skip to content

Commit

Permalink
fixed empty dataverse error (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
opaduchak authored Nov 27, 2024
1 parent 6ce8667 commit fecbb9e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion addon_imps/storage/dataverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ async def list_root_items(self, page_cursor: str = "") -> storage.ItemSampleResu
],
) as response:
content = await response.json_content()
return parse_mydata(content["data"])
if resp_data := content.get("data"):
return parse_mydata(resp_data)
return ItemSampleResult(items=[], total_count=0)

async def get_item_info(self, item_id: str) -> storage.ItemResult:
if not item_id:
Expand Down

0 comments on commit fecbb9e

Please sign in to comment.