Skip to content

修复渲染首页每日新番海报(Bangumi)接口返回images: null的空指针导致白屏报错异常 - #122

Merged
Stardm0 merged 1 commit into
Stardm0:mainfrom
YFL4K:fix/scr/app/page.tsx
Oct 19, 2026
Merged

Stardm0 merged 1 commit into
Stardm0:mainfrom
YFL4K:fix/scr/app/page.tsx

Conversation

@YFL4K

@YFL4K YFL4K commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

修复海报(anime.images.large)空指针崩溃:将新番列表渲染中的 anime.images.large 等 5 处属性访问全部改为可选链写法(anime.images?.large || anime.images?.common || ... || ''),并对 bangumiCalendarData 增加了数组校验与 .filter(Boolean) 空项过滤,彻底解决番剧缺失封面图时触发 TypeError: Cannot read properties of null (reading 'large') 导致整页白屏的问题。
image

修复海报(anime.images.large)空指针崩溃:将新番列表渲染中的 anime.images.large 等 5 处属性访问全部改为可选链写法(anime.images?.large || anime.images?.common || ... || ''),并对 bangumiCalendarData 增加了数组校验与 .filter(Boolean) 空项过滤,彻底解决番剧缺失封面图时触发 TypeError: Cannot read properties of null (reading 'large') 导致整页白屏的问题。
@netlify

netlify Bot commented Oct 19, 2026

Copy link
Copy Markdown

👷 Deploy request for stardm pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 2fe66c2

@Stardm0
Stardm0 merged commit 613bc32 into Stardm0:main Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants