ayushtkn commented on a change in pull request #2380:
URL: https://github.com/apache/ozone/pull/2380#discussion_r661117604



##########
File path: 
hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/update/server/MockCRLStore.java
##########
@@ -106,7 +106,7 @@ public BigInteger issueCert() throws Exception {
     List<CRLInfo> crlInfos =
         scmCertStore.getCrls(ImmutableList.of(crlId.get()));
 
-    if (crlInfos.isEmpty()) {
+    if (crlInfos == null || crlInfos.isEmpty()) {

Review comment:
       When `crlInfos ` can be `null`? 
   The value is fetched from. 
``scmCertStore.getCrls(ImmutableList.of(crlId.get()));`` and this doesn't look 
like returning a `null` in any case. It is in general returning an empty list, 
if it can not find anything?
   
   Secondly, If I understand the code correct, now if `crlInfos` is null, we 
will log the line below, so, will this ` crlInfos.get(0)` not throw a NPE since 
`crlInfos` is null?
   
   Thirdly, How this `null` check, preventing an `IndexOutOfBoundsException`




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



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to