From 763f98111d03652b0ad903ba487a3b8c83a5ef5d Mon Sep 17 00:00:00 2001 From: ghiscoding Date: Mon, 7 Dec 2020 18:23:02 -0500 Subject: [PATCH] fix(editors): make sure select editor is defined before reading a prop --- packages/common/src/editors/selectEditor.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/common/src/editors/selectEditor.ts b/packages/common/src/editors/selectEditor.ts index 61404c608..a7dbfb71c 100644 --- a/packages/common/src/editors/selectEditor.ts +++ b/packages/common/src/editors/selectEditor.ts @@ -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);