diff --git a/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts b/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts index adbdc3d7e..6d9df9c86 100644 --- a/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts +++ b/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts @@ -116,7 +116,7 @@ export class ForeignKeyFilterComponent extends BaseFilterFieldComponent { } fetchSuggestions() { - const currentRow = this.suggestions.find(suggestion => suggestion.displayString === this.currentDisplayedString); + const currentRow = this.suggestions?.find(suggestion => suggestion.displayString === this.currentDisplayedString); if (currentRow !== undefined) { this.currentFieldValue = currentRow.fieldValue; // this.currentFieldQueryParams = Object.assign({}, ...this.primaeyKeys.map((primaeyKey) => ({[primaeyKey.column_name]: currentRow[primaeyKey.column_name]}))); diff --git a/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts b/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts index aeb9fd0fa..a52e2a16d 100644 --- a/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts +++ b/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts @@ -124,7 +124,7 @@ export class ForeignKeyEditComponent extends BaseEditFieldComponent { } fetchSuggestions() { - const currentRow = this.suggestions.find(suggestion => suggestion.displayString === this.currentDisplayedString); + const currentRow = this.suggestions?.find(suggestion => suggestion.displayString === this.currentDisplayedString); if (currentRow !== undefined) { this.currentFieldValue = currentRow.fieldValue; // this.currentFieldQueryParams = Object.assign({}, ...this.primaeyKeys.map((primaeyKey) => ({[primaeyKey.column_name]: currentRow[primaeyKey.column_name]})));