Skip to content

Commit

Permalink
Null stylesheet check. (ampproject#20200)
Browse files Browse the repository at this point in the history
  • Loading branch information
William Chou authored and Noran Azmy committed Mar 22, 2019
1 parent cc0b557 commit 65ec50a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/service/fixed-layer.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,15 @@ export class FixedLayer {
return;
}



const fixedSelectors = [];
const stickySelectors = [];
for (let i = 0; i < stylesheets.length; i++) {
const stylesheet = stylesheets[i];
// Rare but may happen if the document is being concurrently disposed.
if (!stylesheet) {
dev().error(TAG, 'Aborting setup due to null stylesheet.');
return;
}
const {ownerNode} = stylesheet;
if (stylesheet.disabled ||
!ownerNode ||
Expand Down

0 comments on commit 65ec50a

Please sign in to comment.