diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue index 66a30c296..979f53d74 100644 --- a/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue +++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/OnTheFly/components/OnTheFly.vue @@ -229,18 +229,14 @@ export default { data = this.$refs.castThirdparty.$data.thirdparty; // console.log('data original', data); data.parent = {type: "thirdparty", id: this.parent.id}; - data.civility = {type: 'chill_main_civility', id: data.civility.id}; - data.profession = {type: 'third_party_profession', id: data.profession.id}; + data.civility = data.civility !== null ? {type: 'chill_main_civility', id: data.civility.id} : null; + data.profession = data.profession !== null ? {type: 'third_party_profession', id: data.profession.id} : null; } else { type = this.$refs.castNew.radioType; data = this.$refs.castNew.castDataByType(); // console.log('type', type); - if (null !== data.civility) { - data.civility = {type: 'chill_main_civility', id: data.civility.id}; - } - if (null !== data.profession) { - data.profession = {type: 'third_party_profession', id: data.profession.id}; - } + data.civility = data.civility !== null ? {type: 'chill_main_civility', id: data.civility.id} : null; + data.profession = data.profession !== null ? {type: 'third_party_profession', id: data.profession.id} : null; // console.log('onthefly data', data); } } else {