fix(link): check whether description exists before trying to merge duplicates
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
4119ef7203
commit
6a690be141
1 changed files with 3 additions and 1 deletions
|
|
@ -441,7 +441,9 @@ frappe.ui.form.ControlLink = class ControlLink extends frappe.ui.form.ControlDat
|
|||
if (newArr.length === 0) return [currElem];
|
||||
let element_with_same_value = newArr.find((e) => e.value === currElem.value);
|
||||
if (element_with_same_value) {
|
||||
element_with_same_value.description += `, ${currElem.description}`;
|
||||
if (currElem.description) {
|
||||
element_with_same_value.description += `, ${currElem.description}`;
|
||||
}
|
||||
return [...newArr];
|
||||
}
|
||||
return [...newArr, currElem];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue