From 253fccdfcf5db8698c263126b0b35742a69283af Mon Sep 17 00:00:00 2001 From: Gerard Downes Date: Mon, 10 Jan 2022 17:11:14 +0000 Subject: [PATCH] =?UTF-8?q?Add=20additional=20exception=20case=20to=20catc?= =?UTF-8?q?h=20ConnectionPoolTimeoutException=E2=80=A6=20(#637)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add NPE catch https://github.com/newrelic/newrelic-java-agent/issues/256 --- .../src/main/java/com/newrelic/agent/RPMService.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/newrelic-agent/src/main/java/com/newrelic/agent/RPMService.java b/newrelic-agent/src/main/java/com/newrelic/agent/RPMService.java index cc0eaa32e7..eebf6ae3ad 100644 --- a/newrelic-agent/src/main/java/com/newrelic/agent/RPMService.java +++ b/newrelic-agent/src/main/java/com/newrelic/agent/RPMService.java @@ -863,11 +863,13 @@ public void harvest(StatsEngine statsEngine) { // LicenseException handled here logMetricDataError(e); retry = true; - String message = e.getMessage().toLowerCase(); - // if our data can't be parsed, we probably have a bad metric - // (web transaction maybe?). clear out the metrics - if (message.contains("json") && message.contains("parse")) { - retry = false; + if (e.getMessage() != null) { + String message = e.getMessage().toLowerCase(); + // if our data can't be parsed, we probably have a bad metric + // (web transaction maybe?). clear out the metrics + if (message.contains("json") && message.contains("parse")) { + retry = false; + } } } long duration = System.nanoTime() - startTime;