You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by el...@apache.org on 2018/06/14 16:26:08 UTC

[trafficcontrol] 06/07: added null check to prevent NPE

This is an automated email from the ASF dual-hosted git repository.

elsloo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit dce41530806e363b13ebf99b38bcd6998ef26af5
Author: Dewayne Richardson <de...@apache.org>
AuthorDate: Tue Jun 5 08:42:31 2018 -0600

    added null check to prevent NPE
---
 .../traffic_router/core/util/AbstractResourceWatcher.java              | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcher.java b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcher.java
index 9574497..a9c634d 100644
--- a/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcher.java
+++ b/traffic_router/core/src/main/java/com/comcast/cdn/traffic_control/traffic_router/core/util/AbstractResourceWatcher.java
@@ -129,6 +129,9 @@ public abstract class AbstractResourceWatcher extends AbstractServiceUpdater {
 
 	@Override
 	protected File downloadDatabase(final String url, final File existingDb) {
+		if ((trafficOpsUtils.getHostname() == null) || trafficOpsUtils.getCdnName() == null) {
+			return null;
+		}
 		final String interpolatedUrl = trafficOpsUtils.replaceTokens(url);
 		if (fetcher == null) {
 			LOGGER.warn("[" + getClass().getSimpleName() + "] Waiting for configuration to be processed, unable to download from '" + interpolatedUrl + "'");

-- 
To stop receiving notification emails like this one, please contact
elsloo@apache.org.