Skip to content

Commit

Permalink
Make sure the computed style is truthy before dereferencing it, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
lazd committed Aug 25, 2015
1 parent e417707 commit fe0742d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inobounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
while (el !== document.body) {
// Get some style properties
var style = window.getComputedStyle(el);

if (!style) {
// If we've encountered an element we can't compute the style for, get out
break;
}

var scrolling = style.getPropertyValue('-webkit-overflow-scrolling');
var overflowY = style.getPropertyValue('overflow-y');
var height = parseInt(style.getPropertyValue('height'), 10);
Expand Down

0 comments on commit fe0742d

Please sign in to comment.