DonalEvans commented on a change in pull request #6511:
URL: https://github.com/apache/geode/pull/6511#discussion_r640143383



##########
File path: 
geode-apis-compatible-with-redis/src/main/java/org/apache/geode/redis/internal/pubsub/PubSubImpl.java
##########
@@ -66,16 +69,18 @@ public int getSubscriptionCount() {
   public long publish(Region<RedisKey, RedisData> dataRegion, byte[] channel, 
byte[] message) {
     PartitionRegionInfo info = 
PartitionRegionHelper.getPartitionRegionInfo(dataRegion);
     Set<DistributedMember> membersWithDataRegion = new HashSet<>();
-    for (PartitionMemberInfo memberInfo : info.getPartitionMemberInfo()) {
-      membersWithDataRegion.add(memberInfo.getDistributedMember());
+    if (info != null) {

Review comment:
       Looking into it a bit, this null check should be unnecessary, as 
`PartitionRegionHelper.getPartitionRegionInfo()` only returns null if we hit a 
`ClassCastException` during it, but nothing in that method actually throws one. 
It's outside the scope of these changes to go fixing it though, so for now I'll 
just remove the check and let IntelliJ complain about it.




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

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


Reply via email to