Skip to content

Commit

Permalink
fix(editors): make sure select editor is defined before reading a prop
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 7, 2020
1 parent e4fe715 commit 763f981
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/common/src/editors/selectEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ export class SelectEditor implements Editor {
// else we use the path provided in the Field Column Definition
const objectPath = this.columnEditor && this.columnEditor.complexObjectPath || fieldName;
const currentValue = (isComplexObject) ? getDescendantProperty(item, objectPath as string) : (item.hasOwnProperty(fieldName) && item[fieldName]);
const value = (isComplexObject && currentValue.hasOwnProperty(this.valueName)) ? currentValue[this.valueName] : currentValue;
const value = (isComplexObject && currentValue?.hasOwnProperty(this.valueName)) ? currentValue[this.valueName] : currentValue;

if (this.isMultipleSelect && Array.isArray(value)) {
this.loadMultipleValues(value);
Expand Down

0 comments on commit 763f981

Please sign in to comment.