yyqdbngt opened a new pull request, #749:
URL: https://github.com/apache/rocketmq-dashboard/pull/749

   ### Problem
   
   `MessageServiceImpl.moveEndOffset` loops `query.getPageSize()` times 
(independent of the list size), and every iteration does:
   
   ```java
   QueueOffsetInfo nextQueueOffset = queueOffsets.get(next);
   next = (next + 1) % size;
   ```
   
   When `queueOffsets` is **empty** — e.g. querying messages by page for a 
topic that has no message queues — `size` is `0`, so `queueOffsets.get(next)` 
throws `IndexOutOfBoundsException` and `(next + 1) % size` divides by zero 
(`ArithmeticException`).
   
   ### Fix
   
   Return early when the queue offset list is empty.
   
   ### Verification
   
   `mvn compiler:compile` passes (`BUILD SUCCESS`).
   
   ### Diff
   
   1 file changed, +6.


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