From 947cef058e9a4f76daf4dba98565b1772aa9149c Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Wed, 30 Aug 2023 13:28:15 -0400 Subject: [PATCH] fix: None handling --- y/prices/utils/ypriceapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/y/prices/utils/ypriceapi.py b/y/prices/utils/ypriceapi.py index bd209dd9e..7871b494e 100644 --- a/y/prices/utils/ypriceapi.py +++ b/y/prices/utils/ypriceapi.py @@ -148,7 +148,8 @@ async def get_price( return None session = await get_session() async with session.get(f'/get_price/{chain.id}/{token}?block={block}') as response: - return UsdPrice(await read_response(response, token, block)) + if price := await read_response(response, token, block): + return UsdPrice(price) except asyncio.TimeoutError: logger.warning(f'ypriceAPI timed out for {token} at {block}.{FALLBACK_STR}') except ContentTypeError: