DaanHoogland commented on code in PR #7274:
URL: https://github.com/apache/cloudstack/pull/7274#discussion_r1176657990


##########
server/src/main/java/com/cloud/resourcelimit/ResourceLimitManagerImpl.java:
##########
@@ -270,7 +281,7 @@ public void incrementResourceCount(long accountId, 
ResourceType type, Long... de
             return;
         }
 
-        long numToIncrement = (delta.length == 0) ? 1 : delta[0].longValue();
+        long numToIncrement = (delta.length == 0) ? 1 : delta[0];

Review Comment:
   please don“t revert. either is wrong. The original is a potention null 
pointer and so is this. I think
   ```suggestion
           long numToIncrement = (delta.length == 0) ? 1 : (delta[0] == null) ? 
0 : delta[0];
   ```
   would be guarding against all possibilities.



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