diff --git a/assets/javascripts/discourse/components/ad-slot.js.es6 b/assets/javascripts/discourse/components/ad-slot.js.es6 index 297e224..6b6aef1 100644 --- a/assets/javascripts/discourse/components/ad-slot.js.es6 +++ b/assets/javascripts/discourse/components/ad-slot.js.es6 @@ -47,8 +47,13 @@ export default Ember.Component.extend({ @computed("placement") adComponents(placement) { // Check house ads first - const houseAds = this.site.get("house_creatives"), - adsForSlot = houseAds.settings[placement.replace(/-/g, "_")]; + const houseAds = this.site.get("house_creatives"); + if (!houseAds || !houseAds.settings) { + return []; + } + + const adsForSlot = houseAds.settings[placement.replace(/-/g, "_")]; + if ( Object.keys(houseAds.creatives).length > 0 && !Ember.isBlank(adsForSlot) diff --git a/assets/javascripts/discourse/components/house-ad.js.es6 b/assets/javascripts/discourse/components/house-ad.js.es6 index 726110b..7434a3e 100644 --- a/assets/javascripts/discourse/components/house-ad.js.es6 +++ b/assets/javascripts/discourse/components/house-ad.js.es6 @@ -56,8 +56,13 @@ export default AdComponent.extend({ }, adsNamesForSlot(placement) { - const houseAds = this.site.get("house_creatives"), - adsForSlot = houseAds.settings[placement]; + const houseAds = this.site.get("house_creatives"); + + if (!houseAds || !houseAds.settings) { + return []; + } + + const adsForSlot = houseAds.settings[placement]; if ( Object.keys(houseAds.creatives).length > 0 &&