Index: webkit/glue/devtools/js/devtools.js |
diff --git a/webkit/glue/devtools/js/devtools.js b/webkit/glue/devtools/js/devtools.js |
index 0c2fb896df103efa02291862254d9c35f514f1f1..f1e9490d3b0516786629ce7cf48baa80446e21e0 100644 |
--- a/webkit/glue/devtools/js/devtools.js |
+++ b/webkit/glue/devtools/js/devtools.js |
@@ -338,11 +338,13 @@ WebInspector.UIString = function(string) { |
(function() { |
var originalDragStart = WebInspector.elementDragStart; |
WebInspector.elementDragStart = function(element) { |
- var glassPane = document.createElement("div"); |
- glassPane.style.cssText = |
- 'position:absolute;width:100%;height:100%;opacity:0;z-index:1'; |
- glassPane.id = 'glass-pane-for-drag'; |
- element.parentElement.appendChild(glassPane); |
+ if (element) { |
+ var glassPane = document.createElement("div"); |
+ glassPane.style.cssText = |
+ 'position:absolute;width:100%;height:100%;opacity:0;z-index:1'; |
+ glassPane.id = 'glass-pane-for-drag'; |
+ element.parentElement.appendChild(glassPane); |
+ } |
originalDragStart.apply(this, arguments); |
}; |
@@ -352,7 +354,9 @@ WebInspector.UIString = function(string) { |
originalDragEnd.apply(this, arguments); |
var glassPane = document.getElementById('glass-pane-for-drag'); |
- glassPane.parentElement.removeChild(glassPane); |
+ if (glassPane) { |
+ glassPane.parentElement.removeChild(glassPane); |
+ } |
}; |
})(); |