aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-23 12:56:27 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2018-03-23 12:56:27 +0530
commit2717e5498e7fd64fe53aabfa98de4930cb27ab3a (patch)
tree790db492830283c8833838dc3a3a38b1755e2569
parent5c7797aeec86fa06aa1a128f57eaf596e0fe482d (diff)
Ignore invalid schemas
Issue-ID: CLI-105 Change-Id: Ie8684832dacb8ce9726737ddb38373001d0f1f14 Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
-rw-r--r--framework/src/main/java/org/onap/cli/fw/utils/OnapCommandDiscoveryUtils.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandDiscoveryUtils.java b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandDiscoveryUtils.java
index 2b3cf941..1732772e 100644
--- a/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandDiscoveryUtils.java
+++ b/framework/src/main/java/org/onap/cli/fw/utils/OnapCommandDiscoveryUtils.java
@@ -246,6 +246,11 @@ public class OnapCommandDiscoveryUtils {
schema.setSchemaURI(resource.getURI().toString());
Object obj = resourceMap.get(OPEN_CLI_SCHEMA_VERSION);
+ if (obj == null) {
+ OnapCommandUtils.LOG.info("Invalid Schema yaml " + schema.getSchemaURI());
+ continue;
+ }
+
schema.setVersion(obj.toString());
if (!schema.getVersion().equalsIgnoreCase(OnapCommandConstants.OPEN_CLI_SCHEMA_VERSION_VALUE_1_0)) {