Skip to content

Fix NPE in DokitMoreFragment when data is null#1217

Open
qiixiao wants to merge 1 commit intodidi:masterfrom
qiixiao:master
Open

Fix NPE in DokitMoreFragment when data is null#1217
qiixiao wants to merge 1 commit intodidi:masterfrom
qiixiao:master

Conversation

@qiixiao
Copy link
Copy Markdown

@qiixiao qiixiao commented Apr 23, 2026

Problem

When the request to DOKIT_MORE_PAGE_URL fails (e.g. HTTP 503 or DNS issue),
the response body may be null or invalid.

The current implementation assumes morePageGroupBean.data is non-null,
which can cause a crash:

java.lang.NullPointerException: morePageGroupBean.data must not be null

Solution

  • Add null safety checks for data and group
  • Fallback to default groups when data is invalid
  • Prevent app crash in unstable network environments

Notes

This API depends on a remote service which may be unreachable in some regions,
so defensive handling is necessary.

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.

1 participant