zjncs opened a new pull request, #11145: URL: https://github.com/apache/rocketmq/pull/11145
### Motivation A typo in the required `-c` option of `mqadmin exportMetrics` made `clusterAddrTable.get(clusterName)` return null, and the following for-each threw a raw `NullPointerException` from inside the command, producing a stack trace instead of an error message. ### Modifications Print a `cluster not exist` error like the sibling cluster commands do. ### Verification Fail-before (new test, run against the unpatched code): ``` ExportMetricsCommandTest#testUnknownClusterReportsCleanError java.lang.NullPointerException: Cannot invoke "java.util.Set.iterator()" because "brokerNameSet" is null ``` Pass-after: ``` Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 -- ExportMetricsCommandTest ``` -- 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]
