DoKit icon indicating copy to clipboard operation
DoKit copied to clipboard

Fix NPE in DokitMoreFragment when data is null

Open qiixiao opened this issue 7 months ago • 0 comments

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.

qiixiao avatar Apr 23 '26 06:04 qiixiao