All pastes #2092206 Raw Edit

Unnamed

public text v1 · immutable
#2092206 ·published 2011-10-21 12:23 UTC
rendered paste body
Index: Source/WebCore/bindings/js/JSDOMBinding.cpp                                                   
===================================================================
--- Source/WebCore/bindings/js/JSDOMBinding.cpp (revision 96810)                                     
+++ Source/WebCore/bindings/js/JSDOMBinding.cpp (working copy)                                       
@@ -269,7 +269,13 @@
                                                                                                     
 DOMWindow* firstDOMWindow(ExecState* exec)                                                          
 {                                                                                                   
-    return asJSDOMWindow(exec->dynamicGlobalObject())->impl();                                      
+  JSValue value = exec->dynamicGlobalObject();                                                      
+  JSDOMWindow *window = toJSDOMWindow(value);                                                       
+                                                                                                    
+  if (window)                                                                                       
+    return window->impl();                                                                          
+  else                                                                                              
+    return 0;                                                                                       
 }                                                                                                   
                                                                                                     
 bool checkNodeSecurity(ExecState* exec, Node* node)