From b4be62708f7bdd2ff2fb5b3e6604197abd12c0e0 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Thu, 18 Feb 2016 14:43:02 -0500 Subject: [PATCH] Hotfix for consuming apps with no defaults defined - Programming is hard --- app/initializers/flash-messages.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/initializers/flash-messages.js b/app/initializers/flash-messages.js index 370c01b0..d3c30462 100644 --- a/app/initializers/flash-messages.js +++ b/app/initializers/flash-messages.js @@ -29,8 +29,8 @@ const addonDefaults = { export function initialize() { const application = arguments[1] || arguments[0]; - const { flashMessageDefaults } = config; - const { injectionFactories } = flashMessageDefaults; + const { flashMessageDefaults } = config || {}; + const { injectionFactories } = flashMessageDefaults || []; const options = merge(addonDefaults, flashMessageDefaults); const shouldShowDeprecation = !(injectionFactories && injectionFactories.length); @@ -38,7 +38,8 @@ export function initialize() { application.inject('service:flash-messages', 'flashMessageDefaults', 'config:flash-messages'); deprecate(INJECTION_FACTORIES_DEPRECATION_MESSAGE, shouldShowDeprecation, { - id: 'ember-cli-flash.deprecate-injection-factories' + id: 'ember-cli-flash.deprecate-injection-factories', + until: '2.0.0' }); options.injectionFactories.forEach((factory) => {