itxaiohanglover opened a new pull request, #412: URL: https://github.com/apache/rocketmq-dashboard/pull/412
## Which Issue(s) This PR Fixes Fixes #411 ## Brief Description When `mqAdminExt.getAllSubscriptionGroup()` returns `null` (e.g. broker not reachable, ACL denied, or 5.x Proxy mode where the call is not supported), the code at line 183 calls `subscriptionGroupWrapper.getSubscriptionGroupTable()` which throws: ``` Cannot invoke "SubscriptionGroupWrapper.getSubscriptionGroupTable()" because "subscriptionGroupWrapper" is null ``` **Root cause**: No null check on the return value of `getAllSubscriptionGroup()` before accessing its methods. **Fix**: 1. Add null check inside the broker loop — if `getAllSubscriptionGroup` returns null, log a warning and skip to the next broker instead of crashing. 2. Fix the post-loop null check (line 197): the original condition `subscriptionGroupWrapper != null && ...isEmpty()` would fall through to line 202 and NPE if `subscriptionGroupWrapper` was null (e.g. empty broker table). Changed to `subscriptionGroupWrapper == null || ...isEmpty()` to handle both cases. ## How Did You Test This Change? Manual code review against the issue stack trace. The fix follows the same null-guard pattern already used elsewhere in the codebase (e.g. `examineSubscriptionGroupConfig` fallback at line 218). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
