@samitouri / QOS-React-2 / commits / 4d62e1ef59

Don't fail if target.ownerDocument is null

See f71dbab.

Ben Alpert committed Feb 10, 2014 at 17:02 UTC 4d62e1ef5967f4b42ba8eb6a3835cc77f30f10e4
1 file changed +6 -1
src/browser/syntheticEvents/SyntheticUIEvent.js
+6 -1
@@ -38,7 +38,12 @@ var UIEventInterface = {
38 return target;
39 } else {
40 var doc = target.ownerDocument;
41 - return doc.defaultView || doc.parentWindow;
41 + // TODO: Figure out why `ownerDocument` is sometimes undefined in IE8.
42 + if (doc) {
43 + return doc.defaultView || doc.parentWindow;
44 + } else {
45 + return window;
46 + }
47 }
48 }
49 },