Fix error when filter for an unknown field is defined

[MAILPOET-4624]
This commit is contained in:
Jan Jakes
2023-04-19 14:43:52 +02:00
committed by Aschepikov
parent 2bded12e54
commit 07266e4833

View File

@@ -5,7 +5,7 @@ import { storeName } from '../../store';
const getValue = ({ field_key, args }: Filter): string | undefined => {
const field = select(storeName).getRegistry().fields[field_key];
switch (field.type) {
switch (field?.type) {
case 'boolean':
return args.value ? __('Yes', 'mailpoet') : __('No', 'mailpoet');
case 'number':