Skip to content

Commit

Permalink
Merge pull request #143 from Netflix/bugfix/nullptr
Browse files Browse the repository at this point in the history
Fix nullptr exception when tags in null.
  • Loading branch information
pkarumanchi9 authored Feb 3, 2025
2 parents 3bf8cd7 + 36f8d22 commit 9b79ce6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public CachedData encode(Object o) {
b = compressed;
flags |= COMPRESSED;
} else {
getLogger().trace("Compression increased the size of %s from %d to %d",
getLogger().debug("Compression increased the size of %s from %d to %d",
o.getClass().getName(), b.length, compressed.length);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ public Counter getCounter(String cName, Collection<Tag> tags) {
if (counterMap.containsKey(name)) {
counter = counterMap.get(name);
} else {
List<Tag> tagList = new ArrayList<Tag>(tags.size() + 1);
int size = 1;
if (tags != null) {
size = tags.size()+1;
}
List<Tag> tagList = new ArrayList<Tag>(size);
tagList.addAll(tags);
final Id id = getId(cName, tagList);
counter = getRegistry().counter(id);
Expand Down

0 comments on commit 9b79ce6

Please sign in to comment.