diff --git a/monkey/monkey_island/cc/ui/src/components/configuration-components/ReformatHook.js b/monkey/monkey_island/cc/ui/src/components/configuration-components/ReformatHook.js index b5f538347..a26987b37 100644 --- a/monkey/monkey_island/cc/ui/src/components/configuration-components/ReformatHook.js +++ b/monkey/monkey_island/cc/ui/src/components/configuration-components/ReformatHook.js @@ -13,7 +13,12 @@ export function reformatConfig(config, reverse = false) { } formattedConfig['keep_tunnel_open_time'] = formattedConfig['advanced']['keep_tunnel_open_time']; } else { - formattedConfig['payloads'] = formattedConfig['payloads'][0]['options']; + if(formattedConfig['payloads'].length !== 0) + { + formattedConfig['payloads'] = formattedConfig['payloads'][0]['options']; + } else { + formattedConfig['payloads'] = {'encryption': {}, 'other_behaviors': {}} + } formattedConfig['advanced'] = {}; formattedConfig['advanced']['keep_tunnel_open_time'] = formattedConfig['keep_tunnel_open_time']; }