Skip to content

Commit

Permalink
fix npe implicit casting on configurable resources checks
Browse files Browse the repository at this point in the history
Signed-off-by: riccardomodanese <riccardo.modanese@eurotech.com>
  • Loading branch information
riccardomodanese authored and Coduz committed Oct 19, 2022
1 parent 5391f7c commit 0d2cfc5
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -215,9 +215,9 @@ protected long allowedChildEntities(KapuaId scopeId, KapuaId targetScopeId, Map<
// maxNumberChildEntities can be null if such property is disabled via the
// isPropertyEnabled() method in the service implementation. In such case,
// it makes sense to treat the service as it had 0 available entities
boolean childAllowInfiniteChildEntities = (Boolean) childConfigValues.get("infiniteChildEntities");
Integer childMaxNumberChildEntities = (Integer) childConfigValues.get("maxNumberChildEntities");
childCount += childAllowInfiniteChildEntities ? Integer.MAX_VALUE : (childMaxNumberChildEntities != null ? childMaxNumberChildEntities : 0);
boolean childAllowInfiniteChildEntities = (boolean) childConfigValues.getOrDefault("infiniteChildEntities", false);
Integer childMaxNumberChildEntities = (Integer) childConfigValues.getOrDefault("maxNumberChildEntities", 0);
childCount += childAllowInfiniteChildEntities ? Integer.MAX_VALUE : childMaxNumberChildEntities;
}

// Max allowed for this account
Expand Down

0 comments on commit 0d2cfc5

Please sign in to comment.