From bab0b7183127e60541f207fb09c373d1d58acffe Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Wed, 20 Jun 2018 13:56:43 -0400 Subject: [PATCH] fix tests using new dependencies --- lib/modules/contracts_manager/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/modules/contracts_manager/index.js b/lib/modules/contracts_manager/index.js index 38e857240..405913f7c 100644 --- a/lib/modules/contracts_manager/index.js +++ b/lib/modules/contracts_manager/index.js @@ -296,14 +296,17 @@ class ContractsManager { let className; function getDependencyCount(contractName, cycleDetector) { + if (!self.contracts[contractName]) { + return 0; + } + if (self.contracts[contractName].dependencyCount || self.contracts[contractName].dependencyCount === 0) { + // Already have that count + return self.contracts[contractName].dependencyCount; + } if (!self.contractDependencies[contractName] || !self.contractDependencies[contractName].length) { self.contracts[contractName].dependencyCount = 0; return 0; } - if (self.contracts[contractName].dependencyCount) { - // Already have that count - return self.contracts[contractName].dependencyCount; - } let total = self.contractDependencies[contractName].length; self.contractDependencies[contractName].some(dependencyName => { if (cycleDetector.indexOf(dependencyName) > -1) {