From c8f61f41fb847a123c631ee26c7a914e4974e0de Mon Sep 17 00:00:00 2001 From: Aaron Caldwell Date: Tue, 19 May 2020 09:10:32 -0600 Subject: [PATCH] Get config in legacy in safe way to accomodate karma tests --- x-pack/legacy/plugins/maps/public/angular/map_controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/legacy/plugins/maps/public/angular/map_controller.js b/x-pack/legacy/plugins/maps/public/angular/map_controller.js index c985b47dda1e5..adae80e7fc50e 100644 --- a/x-pack/legacy/plugins/maps/public/angular/map_controller.js +++ b/x-pack/legacy/plugins/maps/public/angular/map_controller.js @@ -97,7 +97,7 @@ const REACT_ANCHOR_DOM_ELEMENT_ID = 'react-maps-root'; const app = uiModules.get(MAP_APP_PATH, []); // Init required services. Necessary while in legacy -const config = npSetup.plugins.maps.config; +const config = _.get(npSetup, 'plugins.maps.config', {}); const kibanaVersion = npSetup.core.injectedMetadata.getKibanaVersion(); bindNpSetupCoreAndPlugins(npSetup.core, npSetup.plugins, config, kibanaVersion); bindNpStartCoreAndPlugins(npStart.core, npStart.plugins);