Skip to content

Commit

Permalink
Check for null config before adding
Browse files Browse the repository at this point in the history
  • Loading branch information
Channyboy committed Sep 7, 2023
1 parent 941453b commit a6140ff
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public static Collection<HistogramBucketMaxConfiguration> parse(String input) {
}

// LIFO - right most configuration takes precedence
metricBucketMinMax.addFirst(metricBucketConfiguration);
if (metricBucketConfiguration != null) {
metricBucketMinMax.addFirst(metricBucketConfiguration);
}

}
return metricBucketMinMax;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ public static Collection<HistogramBucketMinConfiguration> parse(String input) {
}

// LIFO - right most configuration takes precedence
metricBucketMinMax.addFirst(metricBucketConfiguration);
if (metricBucketConfiguration != null) {
metricBucketMinMax.addFirst(metricBucketConfiguration);
}

}
return metricBucketMinMax;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ public static Collection<TimerBucketMaxConfiguration> parse(String input) {
continue;
}

sloMinConfiguration = new TimerBucketMaxConfiguration(metricName, dur);
if (dur != null) {
sloMinConfiguration = new TimerBucketMaxConfiguration(metricName, dur);

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}
return sloMinConfigCollection;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,13 @@ public static Collection<TimerBucketMinConfiguration> parse(String input) {
continue;
}

sloMinConfiguration = new TimerBucketMinConfiguration(metricName, dur);
if (dur != null) {
sloMinConfiguration = new TimerBucketMinConfiguration(metricName, dur);

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}

// LIFO - right most configuration takes precedence
sloMinConfigCollection.addFirst(sloMinConfiguration);
}
return sloMinConfigCollection;

Expand Down

0 comments on commit a6140ff

Please sign in to comment.