mirror of
https://github.com/A-Minos/nonebot-plugin-tetris-stats.git
synced 2026-03-05 05:36:54 +08:00
🐛 防止历史记录一条都没有的数组越界
This commit is contained in:
@@ -241,7 +241,13 @@ class Processor(ProcessorMeta):
|
|||||||
if extra is not None:
|
if extra is not None:
|
||||||
historical_data = list(historical_data)
|
historical_data = list(historical_data)
|
||||||
historical_data.append(extra)
|
historical_data.append(extra)
|
||||||
|
if not historical_data:
|
||||||
|
return [
|
||||||
|
TETRIOInfo.TetraLeagueHistory.Data(record_at=today - forward, tr=user_info.data.user.league.rating),
|
||||||
|
TETRIOInfo.TetraLeagueHistory.Data(
|
||||||
|
record_at=today.replace(microsecond=1000), tr=user_info.data.user.league.rating
|
||||||
|
),
|
||||||
|
]
|
||||||
histories = [
|
histories = [
|
||||||
TETRIOInfo.TetraLeagueHistory.Data(
|
TETRIOInfo.TetraLeagueHistory.Data(
|
||||||
record_at=i.processed_data.user_info.cache.cached_at.astimezone(ZoneInfo('Asia/Shanghai')),
|
record_at=i.processed_data.user_info.cache.cached_at.astimezone(ZoneInfo('Asia/Shanghai')),
|
||||||
|
|||||||
Reference in New Issue
Block a user