Skip to content

Commit b61dd23

Browse files
dlazerkabrian-brazil
authored andcommitted
Don't throw NPE if .help() wasn't called (prometheus#458)
See issue prometheus#457 Signed-off-by: Dzmitry Lazerka <dlazerka@gmail.com>
1 parent c33fab0 commit b61dd23

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ protected SimpleCollector(Builder b) {
162162
}
163163
fullname = name;
164164
checkMetricName(fullname);
165-
if (b.help.isEmpty()) throw new IllegalStateException("Help hasn't been set.");
165+
if (b.help != null && b.help.isEmpty()) throw new IllegalStateException("Help hasn't been set.");
166166
help = b.help;
167167
labelNames = Arrays.asList(b.labelNames);
168168

0 commit comments

Comments
 (0)