diff --git a/lib/converters/json_to_jdl_entity_converter.js b/lib/converters/json_to_jdl_entity_converter.js index 8c5cd62b..4f24952f 100644 --- a/lib/converters/json_to_jdl_entity_converter.js +++ b/lib/converters/json_to_jdl_entity_converter.js @@ -169,12 +169,14 @@ function addRelationshipsToJDL() { } function dealWithRelationships(relationships, entityName) { - relationships.forEach(relationship => { - const jdlRelationship = getRelationship(relationship, entityName); - if (jdlRelationship) { - configuration.jdl.addRelationship(jdlRelationship); - } - }); + if (relationships !== undefined) { + relationships.forEach(relationship => { + const jdlRelationship = getRelationship(relationship, entityName); + if (jdlRelationship) { + configuration.jdl.addRelationship(jdlRelationship); + } + }); + } } function getRelationship(relationship, entityName) {