Fix compatibility with other js tests

This commit is contained in:
Neil Lalonde 2019-05-03 13:26:16 -04:00
parent 171656304b
commit 26d42e9ed7
2 changed files with 14 additions and 4 deletions

View File

@ -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)

View File

@ -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 &&