Skip to content

Commit

Permalink
Fix case when config is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
ahouchens committed May 5, 2015
1 parent b8ecb49 commit 29bb18c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addon/components/bf-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import layout from '../templates/components/bf-header';
export default Ember.Component.extend({
layout: layout,
appName: function() {
var configTitle = this.container.lookupFactory('config:environment').APP.bonfire.title;
if (Ember.isEmpty(configTitle)) {
var config = this.container.lookupFactory('config:environment');
if (Ember.isEmpty(config.APP.bonfire) || Ember.isEmpty(config.APP.bonfire.title) ) {
return Ember.String.capitalize(this.get('application.namespace.name'));
} else {
return configTitle;
Expand Down

3 comments on commit 29bb18c

@vine77
Copy link
Member

@vine77 vine77 commented on 29bb18c May 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a test that fails without this patch and passes with it?

@ahouchens
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem. Coming soon.

@vine77
Copy link
Member

@vine77 vine77 commented on 29bb18c May 5, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't branched from master. I made a new commit on master to use ENV instead of the application controller to grab the app name, and included property existence checks, so this commit isn't needed. Tests would still be good though.

Please sign in to comment.