You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "guyinyou (via GitHub)" <gi...@apache.org> on 2026/06/11 07:15:06 UTC

[PR] [C#] Fix SetBody validation logic to correctly reject null and empty body [rocketmq-clients]

guyinyou opened a new pull request, #1268:
URL: https://github.com/apache/rocketmq-clients/pull/1268

   The original condition `null != body || body.Length == 0` had two bugs:
   - When body is null, it short-circuits to evaluating `body.Length`, causing NullReferenceException instead of a proper ArgumentException.
   - When body is a non-null empty array (byte[0]), `null != body` is true, so the empty body passes validation silently.
   
   Fix to `null != body && body.Length > 0`, consistent with the Java implementation which uses `ArrayUtils.isNotEmpty(body)`.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [C#] Fix SetBody validation logic to correctly reject null and empty body [rocketmq-clients]

Posted by "RongtongJin (via GitHub)" <gi...@apache.org>.
RongtongJin merged PR #1268:
URL: https://github.com/apache/rocketmq-clients/pull/1268


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org