Skip to content

Commit 456b590

Browse files
committed
minor fix
1 parent 06864b7 commit 456b590

File tree

1 file changed

+6
-3
lines changed
  • x-pack/plugins/security_solution/public/common/components/exceptions/builder

1 file changed

+6
-3
lines changed

x-pack/plugins/security_solution/public/common/components/exceptions/builder/helpers.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,16 +325,19 @@ export const getEntryOnFieldChange = (
325325
newField: IFieldType
326326
): { updatedEntry: BuilderEntry; index: number } => {
327327
const { parent, entryIndex, nested } = item;
328-
const newParentFieldValue =
329-
newField.subType != null && newField.subType.nested != null ? newField.subType.nested.path : '';
330-
const newChildFieldValue = newField.name.split('.').slice(-1)[0];
328+
const newChildFieldValue = newField != null ? newField.name.split('.').slice(-1)[0] : '';
331329

332330
if (nested === 'parent') {
333331
// For nested entries, when user first selects to add a nested
334332
// entry, they first see a row similiar to what is shown for when
335333
// a user selects "exists", as soon as they make a selection
336334
// we can now identify the 'parent' and 'child' this is where
337335
// we first convert the entry into type "nested"
336+
const newParentFieldValue =
337+
newField.subType != null && newField.subType.nested != null
338+
? newField.subType.nested.path
339+
: '';
340+
338341
return {
339342
updatedEntry: {
340343
field: newParentFieldValue,

0 commit comments

Comments
 (0)