Skip to content

Commit

Permalink
Merge pull request #28 from RuslanZavacky/add-check-for-ifa-placeholder
Browse files Browse the repository at this point in the history
Protect from missing placeholder meta tag.
  • Loading branch information
RuslanZavacky authored Oct 10, 2017
2 parents 6ae7506 + 936cd92 commit 0744021
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addon/initializers/asset-map.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ export function initialize(app) {
let assetMapFile = window && window.__assetMapPlaceholder__;

if (!assetMapFile) {
assetMapFile = decodeURIComponent(document.querySelector('[property="ifa:placeholder"]').getAttribute('content'));
let ifaPlaceholder = document.querySelector('[property="ifa:placeholder"]');

if (ifaPlaceholder) {
assetMapFile = decodeURIComponent(ifaPlaceholder.getAttribute('content'));
}
}

if (!assetMapFile) {
Expand Down

0 comments on commit 0744021

Please sign in to comment.