mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-22 07:07:46 +00:00
🐛 Skip exception when dailynote has no data
This commit is contained in:
parent
6facb1dfeb
commit
3fcab79349
@ -520,7 +520,10 @@ class DailyMaterial(Plugin):
|
|||||||
honey_item = HONEY_DATA[item_type].get(item_id)
|
honey_item = HONEY_DATA[item_type].get(item_id)
|
||||||
if honey_item is None:
|
if honey_item is None:
|
||||||
return None
|
return None
|
||||||
icon = await getattr(self.assets_service, item_type)(item_id).icon()
|
try:
|
||||||
|
icon = await getattr(self.assets_service, item_type)(item_id).icon()
|
||||||
|
except KeyError:
|
||||||
|
return None
|
||||||
return ItemData(
|
return ItemData(
|
||||||
id=item_id,
|
id=item_id,
|
||||||
name=typing.cast(str, honey_item[1]),
|
name=typing.cast(str, honey_item[1]),
|
||||||
|
Loading…
Reference in New Issue
Block a user