Showing
1 changed file
with
4 additions
and
2 deletions
@@ -151,8 +151,10 @@ export const formSchemas: FormSchema[] = [ | @@ -151,8 +151,10 @@ export const formSchemas: FormSchema[] = [ | ||
151 | labelField: 'itemText', | 151 | labelField: 'itemText', |
152 | valueField: 'itemValue', | 152 | valueField: 'itemValue', |
153 | onChange(_, record: Record<'label' | 'value', string>) { | 153 | onChange(_, record: Record<'label' | 'value', string>) { |
154 | - const { label } = record; | ||
155 | - setFieldsValue({ [FormField.UNIT_NAME]: label }); | 154 | + if (record) { |
155 | + const { label } = record; | ||
156 | + setFieldsValue({ [FormField.UNIT_NAME]: label }); | ||
157 | + } | ||
156 | }, | 158 | }, |
157 | getPopupContainer: () => document.body, | 159 | getPopupContainer: () => document.body, |
158 | showSearch: true, | 160 | showSearch: true, |