Skip to content

Commit

Permalink
Merge pull request #81 from nypublicradio/kim/testing
Browse files Browse the repository at this point in the history
check for null hostNames
  • Loading branch information
kimlarocca authored Feb 9, 2021
2 parents 6aefac8 + 8210327 commit 47a7f89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mixins/gtm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export default {
const hostNameArray = this.whatsOnNow.onTodaysShowHosts
let hostName = []
// format hostName
hostNameArray.forEach(function (host) {
hostNameArray.forEach(host => (hostName.push(host['first-name'] + ' ' + host['last-name'])))
})
if (hostNameArray) {
hostNameArray.forEach(function (host) {
hostName.push(host['first-name'] + ' ' + host['last-name'])
})
}
hostName = hostName.join()
let intendedUrl = null
if (gaCategory === 'WNYC Player') {
Expand Down

0 comments on commit 47a7f89

Please sign in to comment.