123123213weqw opened a new pull request, #748:
URL: https://github.com/apache/rocketmq-dashboard/pull/748

   ### Problem
   
   `DashboardServiceImpl.queryTopicCurrentData` iterated the topic cache and, 
for every entry, called:
   
   ```java
   result.add(entry.getKey() + "," + value.get(value.size() - 1).split(",")[4]);
   ```
   
   A topic that has **no collected data points yet** maps to an empty list, so 
`value.size() - 1` is `-1` and `value.get(-1)` throws 
`IndexOutOfBoundsException`. Because there is no try/catch, the entire 
`queryTopicCurrentData` endpoint fails as soon as one topic has an empty data 
list.
   
   ### Fix
   
   Skip entries whose value list is `null` or empty before indexing the last 
element.
   
   ### Verification
   
   `mvn compiler:compile` passes (`BUILD SUCCESS`).
   
   ### Diff
   
   1 file changed, +4.


-- 
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]

Reply via email to