diff --git a/addon/ember-internals.js b/addon/ember-internals.js index 65d9a9cb..f9f3d88d 100644 --- a/addon/ember-internals.js +++ b/addon/ember-internals.js @@ -92,7 +92,7 @@ export var OutletBehavior = { setOutletState: function(state) { - if (state.render && state.render.controller && !state._lf_model) { + if (state && state.render && state.render.controller && !state._lf_model) { // This is a hack to compensate for Ember 1.0's remaining use of // mutability within the route state -- the controller is a // singleton whose model will keep changing on us. By locking it diff --git a/tests/integration/helpers/liquid-outlet-test.js b/tests/integration/helpers/liquid-outlet-test.js index 7c75f93e..4d18f799 100644 --- a/tests/integration/helpers/liquid-outlet-test.js +++ b/tests/integration/helpers/liquid-outlet-test.js @@ -110,3 +110,23 @@ QUnit.skip('can see model-to-model transitions on the same route', function(asse assert.equal(this.$('.content').text().trim(), '2'); assert.ok(tmap.transitionFor.called, 'transitionFor called'); }); + +test('tolerates empty content when parent outlet is stable', function(assert) { + this.render('A{{liquid-outlet}}B'); + + var state = { + render: { + template: Ember.Handlebars.compile('C{{liquid-outlet "a"}}D{{liquid-outlet "b"}}E') + }, + outlets: {} + }; + + setOutletState(state); + assert.equal(this.$().text().trim(), 'ACDEB'); + state.outlets.a = { + render: { template: Ember.Handlebars.compile('foo') }, + outlets: {} + }; + setOutletState(state); + assert.equal(this.$().text().trim(), 'ACfooDEB'); +});