You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "caigy (via GitHub)" <gi...@apache.org> on 2023/04/17 02:31:36 UTC

[GitHub] [rocketmq] caigy commented on a diff in pull request #6596: [ISSUE#6595] fix NPE and repeat access key log

caigy commented on code in PR #6596:
URL: https://github.com/apache/rocketmq/pull/6596#discussion_r1168102758


##########
acl/src/main/java/org/apache/rocketmq/acl/plain/PlainPermissionManager.java:
##########
@@ -613,10 +615,11 @@ public void validate(PlainAccessResource plainAccessResource) {
 
         // Check the white addr for accessKey
         String aclFileName = accessKeyTable.get(plainAccessResource.getAccessKey());
-        PlainAccessResource ownedAccess = aclPlainAccessResourceMap.get(aclFileName).get(plainAccessResource.getAccessKey());
-        if (null == ownedAccess) {
+        if (aclPlainAccessResourceMap.get(aclFileName) == null ||
+                aclPlainAccessResourceMap.get(aclFileName).get(plainAccessResource.getAccessKey()) == null) {

Review Comment:
   You'd better extract `aclPlainAccessResourceMap.get(aclFileName)` as a variable so that the code would be more clear.



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