diff --git a/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractor.java b/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractor.java
index 5f3d15b..d5ba793 100644
--- a/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractor.java
+++ b/src/main/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractor.java
@@ -187,11 +187,14 @@
      *            the path to the CSAR file
      * @return a List of Vendor Image Configurations
      * @throws SdcToscaParserException
+     *             if the SDC TOSCA parser determines that the CSAR is invalid
      * @throws ToscaToCatalogException
+     *             if there are no software versions defined for an image
      * @throws InvalidNumberOfNodesException
+     *             if multiple VNF configuration nodes are found in the CSAR
      */
     private List<VendorImageConfiguration> createVendorImageConfigurations(String csarFilepath)
-            throws SdcToscaParserException, InvalidNumberOfNodesException {
+            throws SdcToscaParserException, ToscaToCatalogException, InvalidNumberOfNodesException {
         ISdcCsarHelper csarHelper = SdcToscaParserFactory.getInstance().getSdcCsarHelper(csarFilepath);
 
         List<NodeTemplate> serviceVfList = ToscaParser.getServiceNodeTemplates(csarHelper)
@@ -215,7 +218,11 @@
                         + vnfConfigs.size() + " nodes were found in the CSAR.");
             }
 
-            return createVendorImageConfigurations(serviceVfList, vnfConfigurationNode);
+            try {
+                return createVendorImageConfigurations(serviceVfList, vnfConfigurationNode);
+            } catch (IllegalArgumentException e) {
+                throw new ToscaToCatalogException(e.getMessage());
+            }
         }
 
         return Collections.emptyList();
@@ -263,8 +270,11 @@
      *            the node template for the VF
      *
      * @return a stream of VendorImageConfiguration objects
+     * @throws IllegalArgumentException
+     *             if the VF has no child node templates which contain images (complex properties) that have software
+     *             version strings
      */
-    private Stream<VendorImageConfiguration> buildVendorImageConfigurations(
+    Stream<VendorImageConfiguration> buildVendorImageConfigurations(
             Collection<Map<String, Map<String, String>>> flavorMaps, NodeTemplate vfNodeTemplate) {
         String resourceVendor = vfNodeTemplate.getMetaData().getValue("resourceVendor");
         applicationLogger.debug("Resource Vendor " + resourceVendor);
@@ -273,6 +283,10 @@
                 extractSoftwareVersions(vfNodeTemplate.getSubMappingToscaTemplate().getNodeTemplates());
         applicationLogger.debug("Software Versions: " + softwareVersions);
 
+        if (softwareVersions.isEmpty()) {
+            throw new IllegalArgumentException("No software versions could be found for this CSAR file");
+        }
+
         return flavorMaps.stream() //
                 .map(value -> value.entrySet().stream() //
                         .filter(entry -> VENDOR_INFO.equals(entry.getKey())) //
diff --git a/src/test/java/org/onap/aai/babel/csar/vnfcatalog/SdcToscaHelper.java b/src/test/java/org/onap/aai/babel/csar/vnfcatalog/SdcToscaHelper.java
index 6fbb1f1..d285aca 100644
--- a/src/test/java/org/onap/aai/babel/csar/vnfcatalog/SdcToscaHelper.java
+++ b/src/test/java/org/onap/aai/babel/csar/vnfcatalog/SdcToscaHelper.java
@@ -32,7 +32,7 @@
 
     /**
      * Create the test SubstitutionMappings.
-     * 
+     *
      * @return the new Substitution Mappings
      */
     public SubstitutionMappings buildMappings() {
@@ -81,28 +81,32 @@
 
     /**
      * Create a new NodeTemplate and add it to the list (for populating the Substitution Mappings).
+     *
+     * @return the new NodeTemplate
      */
-    public void addNodeTemplate() {
+    public NodeTemplate addNodeTemplate() {
         String name = "node name";
         String type = "tosca.nodes.custom";
 
-        LinkedHashMap<String, Object> nodeTemplate = new LinkedHashMap<>();
-        nodeTemplate.put("type", type);
-        nodeTemplate.put("properties", null);
+        LinkedHashMap<String, Object> ntMap = new LinkedHashMap<>();
+        ntMap.put("type", type);
+        ntMap.put("properties", null);
 
-        LinkedHashMap<String, Object> ntnodeTemplates = buildCustomTypeDefinitions(name, nodeTemplate);
+        LinkedHashMap<String, Object> ntnodeTemplates = buildCustomTypeDefinitions(name, ntMap);
         ntnodeTemplates.put("derived_from", null);
         ntnodeTemplates.put("properties", getImagesDefProps());
 
         LinkedHashMap<String, Object> typeInfo = buildNodeTemplateTypeInfo(getImagesDefProps());
         LinkedHashMap<String, Object> customDefs = buildCustomTypeDefinitions(type, typeInfo);
-        smnodetemplates.add(new NodeTemplate(name, ntnodeTemplates, customDefs, null, null));
+        NodeTemplate nodeTemplate = new NodeTemplate(name, ntnodeTemplates, customDefs, null, null);
+        smnodetemplates.add(nodeTemplate);
+        return nodeTemplate;
     }
 
     /**
      * Simulate the creation of a NodeTemplate by the SDC TOSCA parser. Populate the properties of the NodeTemplate with
      * the supplied images.
-     * 
+     *
      * @param images
      *            the value of the images property
      */
diff --git a/src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java b/src/test/java/org/onap/aai/babel/csar/vnfcatalog/TestVnfVendorImageExtractor.java
similarity index 88%
rename from src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java
rename to src/test/java/org/onap/aai/babel/csar/vnfcatalog/TestVnfVendorImageExtractor.java
index 7a076c5..d76551a 100644
--- a/src/test/java/org/onap/aai/babel/csar/vnfcatalog/VnfVendorImageExtractorTest.java
+++ b/src/test/java/org/onap/aai/babel/csar/vnfcatalog/TestVnfVendorImageExtractor.java
@@ -28,6 +28,7 @@
 import static org.hamcrest.CoreMatchers.nullValue;
 import static org.junit.Assert.assertThat;
 
+import com.google.common.collect.ImmutableMap;
 import java.io.IOException;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
@@ -37,11 +38,13 @@
 import org.onap.aai.babel.service.data.BabelArtifact.ArtifactType;
 import org.onap.aai.babel.testdata.CsarTest;
 import org.onap.aai.babel.util.ArtifactTestUtils;
+import org.onap.sdc.toscaparser.api.NodeTemplate;
+import org.onap.sdc.toscaparser.api.elements.Metadata;
 
 /**
  * Tests {@link VnfVendorImageExtractor}.
  */
-public class VnfVendorImageExtractorTest {
+public class TestVnfVendorImageExtractor {
 
     @Test(expected = NullPointerException.class)
     public void createVendorImageMappingsNullCsarSupplied() throws ToscaToCatalogException, IOException {
@@ -89,6 +92,18 @@
                 is(equalTo(new ArtifactTestUtils().getRequestJson("vnfVendorImageConfigurations.json"))));
     }
 
+    /**
+     * Test that an Exception is created when there are no software versions defined for a VF.
+     */
+    @Test(expected = IllegalArgumentException.class)
+    public void testBuildVendorImageConfigurations() {
+        SdcToscaHelper helper = new SdcToscaHelper();
+        NodeTemplate vf = helper.addNodeTemplate();
+        vf.setMetaData(new Metadata(ImmutableMap.of("resourceVendor", "vendor")));
+        vf.setSubMappingToscaTemplate(helper.buildMappings());
+        new VnfVendorImageExtractor().buildVendorImageConfigurations(null, vf);
+    }
+
     @Test
     public void testSoftwareVersions() throws ToscaToCatalogException {
         VnfVendorImageExtractor extractor = new VnfVendorImageExtractor();
