Skip to content
Permalink
Browse files

Make sure that the defaultView exists before attempting to get at the…

… computedStyle (makes it easier to hide items that don't have a view). Fixes #5619.
  • Loading branch information
jeresig committed Dec 10, 2009
1 parent 4e9fed3 commit cf72fba64fd164507752376a578dee7919cec911
Showing with 7 additions and 1 deletion.
  1. +7 −1 src/css.js
@@ -141,7 +141,13 @@ jQuery.extend({

name = name.replace( rupper, "-$1" ).toLowerCase();

var computedStyle = elem.ownerDocument.defaultView.getComputedStyle( elem, null );
var defaultView = elem.ownerDocument.defaultView;

if ( !defaultView ) {
return null;
}

var computedStyle = defaultView.getComputedStyle( elem, null );

if ( computedStyle ) {
ret = computedStyle.getPropertyValue( name );

0 comments on commit cf72fba

Please sign in to comment.
You can’t perform that action at this time.