Skip to content

Commit 61579ec

Browse files
author
Meshwa Savalia
committed
Minor fix for validating storage resolution
1 parent c208e52 commit 61579ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/software/amazon/cloudwatchlogs/emf/util/Validator.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ public static void validateMetric(
124124
throw new InvalidMetricException("Metric unit cannot be null");
125125
}
126126

127-
if (storageResolution == null) {
128-
throw new InvalidMetricException("Metric resolution cannot be null");
127+
if (storageResolution == null
128+
|| storageResolution == StorageResolution.UNKNOWN_TO_SDK_VERSION) {
129+
throw new InvalidMetricException("Metric resolution is invalid");
129130
}
130131

131132
if (metricNameAndResolutionMap.containsKey(name)) {

0 commit comments

Comments
 (0)