From 96d1bd3575c506d86368cb3fe05b4a2327ef8c90 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Wed, 4 Aug 2021 18:47:10 +0800 Subject: [PATCH] Update query_resource.py --- plugins/genshin/query_resource_points/query_resource.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/genshin/query_resource_points/query_resource.py b/plugins/genshin/query_resource_points/query_resource.py index e190269a..d5389186 100644 --- a/plugins/genshin/query_resource_points/query_resource.py +++ b/plugins/genshin/query_resource_points/query_resource.py @@ -153,7 +153,7 @@ async def download_map_init( global CENTER_POINT, MAP_RATIO map_path.mkdir(exist_ok=True, parents=True) _map = map_path / "map.png" - if os.path.getsize(_map) > 1024 * 1024 * 30: + if _map.exists() and os.path.getsize(_map) > 1024 * 1024 * 30: _map.unlink() async with session.get(MAP_URL, timeout=5) as response: if response.status == 200: